How should i get the Paper type at runtime?

Stimulsoft Reports.NET discussion
satisht
Posts: 150
Joined: Mon Apr 09, 2007 12:28 am
Location: Pune

How should i get the Paper type at runtime?

Post 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?
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

How should i get the Paper type at runtime?

Post by Edward »

Please provide me in more details about your task.

Thank you.
satisht
Posts: 150
Joined: Mon Apr 09, 2007 12:28 am
Location: Pune

How should i get the Paper type at runtime?

Post 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?
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

How should i get the Paper type at runtime?

Post 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.
satisht
Posts: 150
Joined: Mon Apr 09, 2007 12:28 am
Location: Pune

How should i get the Paper type at runtime?

Post by satisht »

I have set different papersize in preview window but still it is showing me custom which is by defaut.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

How should i get the Paper type at runtime?

Post by Edward »

Could you please provide me with test solution regarding your task. Please send it to Image for analysis.

Thank you.
satisht
Posts: 150
Joined: Mon Apr 09, 2007 12:28 am
Location: Pune

How should i get the Paper type at runtime?

Post 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.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

How should i get the Paper type at runtime?

Post 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.
satisht
Posts: 150
Joined: Mon Apr 09, 2007 12:28 am
Location: Pune

How should i get the Paper type at runtime?

Post 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..
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

How should i get the Paper type at runtime?

Post 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.
Post Reply