Showing posts with label viewer. Show all posts
Showing posts with label viewer. Show all posts

Monday, March 26, 2012

How to show 2 reports in 1 viewer right after each other

I am using vb.net 2005 and have created 2 reports with Crystal. I have the reports showing fine by themselves, but what I want to happen is as follows:

User generates a detail report > user views/prints report > user closes report > summary report opens > user views/prints summary.

I want both reports to use the same CrystalReportViewer/Form, so once the first report is closed, I want the 2nd one to open. Is this possible?

I am not sure how to accomplish this. Any help?Are you pulling directly from a database or are you populating the data programatically?

This is how we do something similar in vb6 so if you use that you can put one in the close event of the form you are loading... As long as you don't allow them to close throug the view and you close on a button on the screen.

Hope this helps..
Rico

'Defines the CRxdrt object as the application
Set mobjApplication = CreateObject("CrystalRuntime.Application.11")

'Opens the defined report
Set mobjReport = mobjApplication.OpenReport(mcReportName, iOPEN_MULTIUSE)

'Sets the datasource of the report
mobjReport.Database.Tables(1).SetDataSource mrsReportData, 3

'Sets the crview object to the report we just opened
crptViewer.ReportSource = mobjReport

'Makes it viewable on the screen
crptViewer.ViewReport|||Is this the right close event?

Private Sub frmDetailSumm_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed

'my code to load 2nd report

End Sub

Wednesday, March 21, 2012

how to setting report viewer to view exactly as VS preview

hi all..I'm new here and got a problem, and i hope you guys can help me.
My problems:
I want to create one card , size : height =2.25, width =4.5 and it should be
on 2 page because I want to make it front and back.
i 'm using rectangle and textbox, and i set the page break after first
rectangle . When i preview the card, it shows 2 pages, one front and one back,
as it should be.
when i preview using print layout at VS, it became 5 pages. I already setting
using
[(Report.PageWidth - Report.LeftMargin - Report.RightMargin)>=Body.Width] but
it won't do.
And one more thing, when preview it on browser (report viewer), it shows one
full page, not the size of the card. So how can I make the preview setting
only preview the card exactly like the layout of the card, not full screen?
any help will be appreciated. thank you.the HTML version is optimized for a web rendering and the size of the pages
will be different.
but if the user try to print or export in pdf, then the layout will follows
your needs.
maybe you can try to change the interactive size of the report (not the page
size, the interactive size) to see if you can force the HTML page size.
"gmi" <u37770@.uwe> wrote in message news:78d60e78bb21e@.uwe...
> hi all..I'm new here and got a problem, and i hope you guys can help me.
> My problems:
> I want to create one card , size : height =2.25, width =4.5 and it should
> be
> on 2 page because I want to make it front and back.
> i 'm using rectangle and textbox, and i set the page break after first
> rectangle . When i preview the card, it shows 2 pages, one front and one
> back,
> as it should be.
> when i preview using print layout at VS, it became 5 pages. I already
> setting
> using
> [(Report.PageWidth - Report.LeftMargin - Report.RightMargin)>=Body.Width]
> but
> it won't do.
> And one more thing, when preview it on browser (report viewer), it shows
> one
> full page, not the size of the card. So how can I make the preview setting
> only preview the card exactly like the layout of the card, not full
> screen?
> any help will be appreciated. thank you.
>