Page 2 of 3

How should i get the Paper type at runtime?

Posted: Mon Jul 16, 2007 4:18 am
by satisht
This is about if I set the size at runtime but If I set the size after showing the report window then how should I get the Paper size when we closes the window?

How should i get the Paper type at runtime?

Posted: Mon Jul 16, 2007 4:23 am
by Edward
Please provide me in more details about your task.

Thank you.

How should i get the Paper type at runtime?

Posted: Mon Jul 16, 2007 4:51 am
by satisht
IF I change the paper size after showing the report preview window then how should I get the Paper size at the time of closing the window?

How should i get the Paper type at runtime?

Posted: Mon Jul 16, 2007 8:13 am
by Edward
Sorry for my automatically error in the previous post.

Correct line is following:

Code: Select all

Dim page As StiPage = report.CompiledReport.Pages(0)

Please use the following code to obtain the PaperSize of the Rendered report:

Code: Select all

page = Report.CompiledReport.Pages(0)
MessageBox.Show(page.PaperSize.ToString)
Thank you.

How should i get the Paper type at runtime?

Posted: Tue Jul 17, 2007 12:10 am
by satisht
I have set different papersize in preview window but still it is showing me custom which is by defaut.

How should i get the Paper type at runtime?

Posted: Tue Jul 17, 2007 12:45 am
by Edward
Could you please provide me with test solution regarding your task. Please send it to Image for analysis.

Thank you.

How should i get the Paper type at runtime?

Posted: Tue Jul 17, 2007 5:36 am
by satisht
Using form As Stimulsoft.Report.Render.StiPreviewForm = New Stimulsoft.Report.Render.StiPreviewForm(Report)
Dim stiPreview As Stimulsoft.Report.Render.StiPreviewControl = form.PreviewControl
Dim tb As StiToolBar = stiPreview.ToolBar
Dim btnSave As StiToolButton = TryCast(tb.Controls.Item("tbSave"), StiToolButton)
Dim btnExport As StiToolButton = TryCast(tb.Controls.Item("tbExport"), StiToolButton)
btnExport.Image = btnSave.Image
Report.Render()
Report.Compile()
form.ShowDialog()
Dim page As StiPage = Report.CompiledReport.Pages(0)
MessageBox.Show(page.PaperSize.ToString)
End Using

I am not having test solution but I have used above code to see the papersize of page before closing the preview window.

How should i get the Paper type at runtime?

Posted: Tue Jul 17, 2007 7:46 am
by Edward
Please change the following string

Code: Select all

'This collection of pages is ready for rendering and changes into it reflect on the result of the rendering.
Dim page As StiPage = Report.CompiledReport.Pages(0)
to

Code: Select all

'This is a collection of the Rendered pages which are represented in the preview window.
Dim page As StiPage = Report.RenderedPages(0)
because the Collection of the Rendered pages is stored in the RenderedPages collection. Therefore when you change something in the Preview window after rendering the report this reflects to RenderedPages collection.

Thank you.

How should i get the Paper type at runtime?

Posted: Thu Jul 19, 2007 4:56 am
by satisht
Yes I have used RenderedPages(0) but still i am getting Custom when I have set the type as "A4". I dont know but where ur storing these changes afeter showing the report I need the use that page size after showing the preview window and before closing the preview window. I have used above code but still i am getting custom type of report. Please help me..
Thank You..

How should i get the Paper type at runtime?

Posted: Thu Jul 19, 2007 7:48 am
by Edward
Please send your solution to Image. When we will see the issue in your solution, we be able to help you, otherwise it is not possible.

Thank you.