locked
pass report Total amount value from Crystal Report into VB.Net application RRS feed

  • Question

  • Hi, I was wondering, is it possible to pass back a value from crystal report such as Total Amount calculation back into VB.NET? or maybe pass back the value and save/update the value into the database?

     

    thank you.

    Friday, August 10, 2007 6:15 AM

Answers

  •  

    I am also doing it in VS2005 with bundled crystal report

     

    You should find unload event if not then write like below

     

    protected void CrystalReportViewer1_Unload(object sender, EventArgs e)

    {

                 double Ab = (double)ReportTemp.Rows[1][3];

    }

     

    Its ok you keep your total in group footer but to get it in Rows collection it should be in detail section.

     

    Let me know

    Monday, August 13, 2007 8:22 AM
  • I am talking abount unload event of Crystalreportviewer & not the page_unload event

     

    declare class level variable & assign that with Reportdocument object

     

    And in Crystal Report Viewer Unload event use this to get rows collection

     

    Whichever column you want to access drag & drop it in detail section & if you don't need it suppress it

     

    Let me know

    Tuesday, August 14, 2007 3:43 AM

All replies

  • Create New Formula

    Keep it in Detail Section & Suppress it

     

    Declare Class level variable Crystal Report Viewer

    Set instance of report to that variable

     

    In CrystalReportViewer1_Unload event of Crystal Report Viewer

    ReportVariable.Rows[0][Column Index]

     

    You will get the value of that formula

     

    Column Index: Just check sequence of Columns in your report

     

    Hot it helps

    Friday, August 10, 2007 9:59 AM
  • hi sorry...i am really newbie in crystal report...do you mind to show some samples? or any website links i can refer to? thanks a lot and sorry again for asking too much...

    Monday, August 13, 2007 4:13 AM
  •  TommyGL wrote:

    hi sorry...i am really newbie in crystal report...do you mind to show some samples? or any website links i can refer to? thanks a lot and sorry again for asking too much...

     

    just to make it clearer:

     

    in Form1 (to choose the report title according to user preference):

    Dim rptnamestr As String = "TrackingReport"

    Dim cmsfm As New print_screen()                     --> reportViewer

    cmsfm.asset(rptnamestr, "")                                    

    cmsfm.Show()                                                  --> show the reportViewer

     

    in Print_Screen form (to preview the report/reportViewer form)

    Sub asset(ByVal rptnamestr As String, ByVal param As String)

    .................................                                      --> seaching for the report and display it.

    rptViewer.ReportSource = rptDocument

    End Sub

     

    Please help and point where I should put in the codes to get the formula value from crystal report back to my application....Thank you,

    Monday, August 13, 2007 6:02 AM
  • you can have a look at following & in Unload event write code to get formula values

     

    http://www.keepandshare.com/doc/view.php?id=141430&da=y

     

    Hope it helps

    Monday, August 13, 2007 6:44 AM
  •  

    i am using vb 2005 with bundled cyrstal report....unable to find unload...i am using formclosing event instead...but wonder why when i call the rpt viewer, it prompts "Missing parameter values"...

     

    i am going to take value from Groupfooter and not from Details section.Any other workaround? thanks a lot for the help.

    Monday, August 13, 2007 7:54 AM
  •  

    I am also doing it in VS2005 with bundled crystal report

     

    You should find unload event if not then write like below

     

    protected void CrystalReportViewer1_Unload(object sender, EventArgs e)

    {

                 double Ab = (double)ReportTemp.Rows[1][3];

    }

     

    Its ok you keep your total in group footer but to get it in Rows collection it should be in detail section.

     

    Let me know

    Monday, August 13, 2007 8:22 AM
  • i am unable to use the unload event in the vb...it highlights the error on object...the unload part is equal to form_closing event....everytime i call the report, it prompts me Missing parameter values...

     

    my report is like this

     

    Month: July

    last month balance        IN                  OUT               total balance(last month + IN) - OUT))

    10                                5                     0                           15

    25                                0                     15                          10

     

    Month: August

    last month balance        IN                  OUT               total balance(last month + IN) - OUT))

    15                                0                     10                           5

    20                                0                     5                             15

     

    and so on....

     

    how can i save the total balance for the month and then the next month report, it will become the last month balance...i am planning to save the total balance monthly into the database....

    Is there any other ways to do this report? Again, thank you for the help.

     

     

     

    Tuesday, August 14, 2007 12:48 AM
  • I am talking abount unload event of Crystalreportviewer & not the page_unload event

     

    declare class level variable & assign that with Reportdocument object

     

    And in Crystal Report Viewer Unload event use this to get rows collection

     

    Whichever column you want to access drag & drop it in detail section & if you don't need it suppress it

     

    Let me know

    Tuesday, August 14, 2007 3:43 AM