About FastReport Studio and FastReport.exe
I am a VC++ programmer, and I use the FastReport Studio 3.20 by the com interface provided by FastReport3.dll. According the doccumentation's guidelines, I import the FastReport3.dll type lib correctly. I want to set some memo to be printed or not during the runtime. You know this is very easy in the FastReport.exe application which is controalled by the printable property of the memo, but I cannot find any related information from the FastReport3.tlh or the FastReport3.tli file generated from FastReport3.dll. So I have no any method to implete this by code. I miss that maybe the FastReport3.dll doesn't implemente all the interfaces which provided by Fast Report 3. Is it true? If so, how should I do for my goal? Thks a lot.
Comments
Get_Frame(out Value: IfrxFrame): HResult
{//Insert a new memoview to the existing fr3 file
IfrxReportPtr m_pReport(__uuidof(TfrxReport));
CString strReportFile = "Dynamic created report.fr3";
m_pReport->LoadReportFromFile( (_bstr_t)strReportFile );
IfrxComponent * pReportComponent = NULL;
IfrxComponent * pReportPageComponent = NULL;
IfrxComponent * pMemoViewComponent = NULL;
IfrxCustomMemoView * pCustomMemoView = NULL;
IfrxMemoView * pMemoView = NULL;
m_pReport->QueryInterface(__uuidof(IfrxComponent), (void**) &pReportComponent);
pReportComponent->GetObject( 0, &pReportPageComponent );
double top = 200;
double height = 100;
double width = 200;
double left = 100;
{
CString strName;
CString strData;
int i = rand();// i is a random integer
{//Add a new memoview
strName.Format( "Memo%04d", i+1 );
pMemoViewComponent = m_pReport->CreateReportObject(
pReportPageComponent,
__uuidof(IfrxMemoView), (_bstr_t)strName);
pMemoViewComponent->put_Left( left );
pMemoViewComponent->put_Top( top );
pMemoViewComponent->put_Height( height );
pMemoViewComponent->put_Width( width );
strData.Format( "%02d", i+ 1 );
pMemoViewComponent->QueryInterface(
__uuidof(IfrxMemoView), (PVOID*) &pMemoView);
pMemoView->PutMemo( (_bstr_t)strData );
pMemoView->PutHAlign( hAlignCenter );
pMemoView->PutVAlign( vAlignCenter );
//How can I set frame style of the new created memoview?
//Method 1 :IfrxFrame * pFrame = pMemoView->GetFrame();
//Method 2 :pMemoViewComponent->QueryInterface(
//__uuidof(IfrxFrame), (PVOID*) &pFrame);
//The following code cannot execute because the pFrame pointer is NULL
//long type = pFrame->GetFrameType();
}//Add a new memoview
}
m_pReport->ShowReport();
//now I can get the new memoview has the properties such as the left, top, and hAlignCenter and so on
//But It hasnot the desired properties such as the left,right,top,and bottom frame border
m_pReport->SaveReportToFile("Dynamic created report.fr3");
if(pCustomMemoView) pCustomMemoView->Release();
if(pMemoViewComponent) pMemoViewComponent->Release();
if(pReportComponent) pReportComponent->Release();
if(pReportPageComponent) pReportPageComponent->Release();
}//Insert a new memoview to the existing fr3 file