Answers
次问题好像很麻烦,不过可以用TVSPrinter试试看。
IFieldCollectionPtr fieldCollectionPtr = (IFieldCollectionPtr)TVReport-> Fields;
TVPrint-> PaperHeight = 4300;
TVPrint-> PaperWidth = 4300;
for (long i = 0; i < fieldCollectionPtr-> Count ;i++)
{
Variant v = i;
VARIANT v1 =v;
FieldPtr fieldPtrTail = fieldCollectionPtr-> getItem( v1);
IVSReportPtr subReportPtr = fieldPtrTail-> getSubreport();
String strTailText = fieldPtrTail-> Name;
if ( strTailText.AnsiCompareIC( "name " ) == 0 )
{
fieldPtrTail-> setText(AnsiToOLESTR(serid.cstr()));
}
else if ( strTailText.AnsiCompareIC( "id " ) == 0 )
{
fieldPtrTail-> setText(AnsiToOLESTR(providername.cstr()));
}
else if ( strTailText.AnsiCompareIC( "address " ) == 0 )
{
fieldPtrTail-> setText(AnsiToOLESTR(consumername.cstr()));
}
else if ( strTailText.AnsiCompareIC( "age " ) == 0 )
{
fieldPtrTail-> setText(AnsiToOLESTR(amountsum.cstr()));
}
}
TVReport-> Render((LPDISPATCH)TVPrint-> ControlInterface);