cancel
Showing results for 
Search instead for 
Did you mean: 

Get Field Value from Crystal Report Into Vb.net

Former Member
0 Kudos

Hi

How i get the field value from crystal report  into my vb.net variable

here in crystal report

1) I binded with a Typed Dataset using a view

2 )Done Grouping in crystal report

3)am doing some calculations in GroupFooter and Report Footer using formula fields and RunningTotal Fields,

calculating

GroupTotalGroupDiscount,GroupTotalAmount  in GroupFooter

Total , TotalDiscount, TotalAmount  in ReportFooter

and i want to save these values in database table tbl_Invoice and after saving a row in  table  a invoiceId will generated

and i want to show this Id in Report.

Can i get value and  pass  Invoice Id  to report after  setData source

 CrystalReportViewer1.ReportSource = Report

 If Not ds Is Nothing Then 
If ds.Tables(0) IsNot Nothing Then
 If ds.Tables(0).Rows.Count > 0 Then
 Dim Report As ReportDocument = New ReportDocument 
Report.Load(System.Windows.Forms.Application.StartupPath & "/Reports/" & rptName)  Report.SetDataSource(ds)
CrystalReportViewer1.ReportSource = Report
Me.Panel1.Controls.Add(CrystalReportViewer1) 
Return True
 End If
End If 
End If

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member183750
Active Contributor
0 Kudos

Hello Adil

Obviously, you will have to run the report twice - once to produce the values and second time to show the values. You will have to use the InProc RAS SDK.

E.g.

1) I binded with a Typed Dataset using a view

2 )Done Grouping in crystal report

3)am doing some calculations in GroupFooter and Report Footer using formula fields and RunningTotal Fields,

calculating

GroupTotalGroupDiscount,GroupTotalAmount  in GroupFooter

Total , TotalDiscount, TotalAmount  in ReportFooter

4) Loop through the report sections looking for the field / object and value

5) Get and save the value

6) Close the report

7) Open the report

😎 Pass the value from (5) into t report object (text field, formula(?))

9) Display the report

Additional resources:

Sample apps

How to Use The RAS SDK .NET With In-Process RAS Server

KB - 1550243 - How can I access a formula fields text using the Report Application Server (RAS) .NET SDK?

KB - 1206822 - How to modify the text in a TextObject using Report Application Server and Visual Basic .N...

KB - 1254721 - How to modify a TextObject which contains a parameter, database or formula field using the...

Report Application Server .NET SDK Developer Guide

Report Application Server .NET API Guide

- Ludek

Follow us on Twitter

Got Enhancement ideas? Try the SAP Idea Place

Share Your Knowledge in SCN Topic Spaces