Accessing DMP Report Properties at Runtime

keturpatelketurpatel India
edited February 2011 in FastReport Studio
I am evaluating Fast Report Studio version 4.8.212, Front end Visual Basic 6, OS Windows XP sP3

I have created a project to generate report at run time based on user's selections.
It is working perfect in GDI mode. Now i want to give user option to choose from GDI or DMP report.

I have made code changes accordingly, but unfortunately, cannot find some properties. I specially want to use following properties, which are available at desgin time from FastReport Designer, but not available at runtime in vb6.


TfrxDMPPage : TopMargin, BottomMargin, LeftMargin, RightMargin, PaperHeight, PaperWidth

TfrxDMPMemoView : Memo, HAlign, StretchMode


For both of above objects, only FontStyle is available.

I can send my code if anyone want to check.

Can some one guide me where i am wrong or limitation in Fast Report itself?
Is there any workaround available for this problem?


many thanks in advance.





UPDATE AS ON 18/02/2011

I have finally found solution for above problem.
I am posting it here for everyone else. Remember that this is VB6 code

Solution 1

To access Margin and Width/Height of TfrxDMPPage, create below function
Private Sub Set_PageMargins(ByRef mPage As IfrxReportPage, mWidth As Double, mHeight As Double, _
                                           mTop As Double, mBot As Double, mLeft As Double, mRight As Double)

    mPage.PaperWidth = mWidth
    mPage.PaperHeight = mHeight
    
    mPage.TopMargin = mTop
    mPage.BottomMargin = mBot
    mPage.LeftMargin = mLeft
    mPage.RightMargin = mRight
End Sub

and call it like
Dim MyRep As FastReport.TfrxReport
Dim DMPRepPage1 As FastReport.IfrxDMPPage
Set DMPRepPage1 = MyRep.CreateReportObjectEx(MyRep, "TfrxDMPPage", "ReportPage")
Call Set_PageMargins(DMPRepPage1, 210, 297, 10, 10, 10, 10)



Solution 2

To access Memo and StretchMode of TfrxDMPMemoView, create below functions
Private Sub SetDMP_Text(ByRef mMemo As IfrxCustomMemoView, mText As String)
     mMemo.Text = mText
End Sub

Private Sub SetDMP_Streach(ByRef mMemo As IfrxStretcheable, mStreach As frxStretchMode)
    mMemo.StretchMode = sm_MaxHeight
End Sub

and call it like
Dim MyRep As FastReport.TfrxReport
Dim MyDMPMemoView As IfrxDMPMemoView
Set MyDMPMemoView = MyRep.CreateReportObjectEx(MyBandHeader, "TfrxDMPMemoView", "Head1")

Call SetDMP_Text(MyDMPMemoView, "Ketur Patel")
Call SetDMP_Streach(MyDMPMemoView, sm_ActualHeight)



Still cannot find solution to set HAlign, VAlign and DisplayFormat of IfrxDMPMemoView from vb6 code.
If anyone can help for that, thanks in advance from me.



.

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.