About FastReport Studio and FastReport.exe

edited January 2006 in FastReport 3.0
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

  • edited 1:20AM
    wrote:
    I miss that maybe the FastReport3.dll doesn't implemente all the interfaces which provided by Fast Report 3. Is it true?
    Yes, it is.
    wrote:
    If so, how should I do for my goal?
    Do you need create memo or change it property?
  • edited January 2006
    As so far, I can create new memo and insert it to the existing Fast Report file, and set some of its properties such as left, top, and so on. But I cannot set some other properties of the new created memo, such as the print-able property and the border line style, becase I donot know how to get the Frame Interface of it. Thks a lot. Now I am trying a not so graceful method, from which the fr3 file is processed as a xml file. After adding the new memo and set its attributes, the result is written into a temp fr3 file, and reload report from the new file.
  • edited 1:20AM
    ???
    Get_Frame(out Value: IfrxFrame): HResult
  • edited 1:20AM
    In order to show my problems, I paste the c++ source code from my project as foloows:

    {//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

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.