Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: Pulling in values from an INI file Post Reply Post New Topic
Author Message
Enzyme80
Newbie
Newbie


Joined: 19 Jan 2007
Location: United States
Online Status: Offline
Posts: 27
Quote Enzyme80 Replybullet Topic: Pulling in values from an INI file
    Posted: 08 Nov 2007 at 10:10am
Hey guys,

I have created a Crystal Report and got it up and running. This report will be exactly the same for all of my customers except for where it says the company name (it is 4 text fields) will change to be their company. The only place where these values are set are in the ini file and then are read into session variables as such
session("CNAME") = company name
Session("ADR1") = adr1
Session("ADR2") = adr2
Session("CSZ") = CSZ

Now all of these sessions are filled in but I cannot figure out how to make them also fill in for crystal reports. I have tried some different things but have yet to get it to work.

Some more info. This is with visual studio 2005 writing in vb.net and using the crystal reports that comes with that version of VS.

Thanks
Kevin
IP IP Logged
Enzyme80
Newbie
Newbie


Joined: 19 Jan 2007
Location: United States
Online Status: Offline
Posts: 27
Quote Enzyme80 Replybullet Posted: 08 Nov 2007 at 10:39am

Dim rptTxtGroup As TextObject
        rptTxtGroup = rpt.ReportDefinition.ReportObjects.Item("Text15")
        rptTxtGroup.Text = Session("Label")
        rptTxtGroup = rpt.ReportDefinition.ReportObjects.Item("Text16")
        rptTxtGroup.Text = Session("ADR1")
        rptTxtGroup = rpt.ReportDefinition.ReportObjects.Item("Text17")
        rptTxtGroup.Text = Session("TEL")
        rptTxtGroup = rpt.ReportDefinition.ReportObjects.Item("Text18")
        rptTxtGroup.Text = Session("City")

This pretty much does what i need at least from what I can tell.  I have done a couple test and they have all passed.

IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.