Solved

how to update a Crystal Report connected to variant num of columns

Posted on 2001-07-08
7
222 Views
Last Modified: 2009-07-29
I trying to add a Crystal Report to my project and to connect this report to a table that has changeable number of columns , Do I have to add this table in a special way and How can I update this report in the run time
0
Comment
Question by:Viki
7 Comments
 
LVL 3

Expert Comment

by:andysalih
ID: 6263934
try this

'Create Temp StorageDim strSelect As String'Create Report instance
Dim Report As New UIBenSummrpt 'Set Mouse Pointer to busy
Screen.MousePointer = vbHourGlass'Set Crystal Reports smartviewer source
'     to reportCRViewer1.ReportSource = Report 'Reset Reports selection criteria
Report.RecordSelectionFormula = "" 'Create a string for selection criteria
strSelect = "{ado.Client}= '" & strClient & "' AND " & "{ado.Year}= '" & strYear & "'"
'Set Report's selection criteriaReport.RecordSelectionFormula = strSelect
'Display ReportCRViewer1.ViewReport 'Reset the mouse pointer icon
Screen.MousePointer = vbDefault

hope this helps
andy
0
 
LVL 3

Accepted Solution

by:
andysalih earned 100 total points
ID: 6263939
or this

'Add the crystal ocx object to form (wil'     l be named CrystalReport1)
' you can pass record selection''NOTE''Create the report in Crystal first and
'     place the report in the same directory a'     s your database.
'' Set the report location to same as da'     tabase in Crystal
''This part is run from menu or command '     button
CrystalReport1.ReportSource = crptReport
CrystalReport1.ReportFileName = reportpath & "\YOUR_REPORT_NAME.rpt"
'***This line only is using single recor'     d selection
CrystalReport1.ReplaceSelectionFormula ("{TABLENAME.FIELDNAME} =" & "'" & v_choice & "'")
'*********CrystalReport1.WindowState = crptMaximizedCrystalReport1.PrintReport
CrystalReport1.PageZoom (50)          

hope you can build of these

cheers

Andy
0
 
LVL 3

Expert Comment

by:andysalih
ID: 6263943
have a look at the following link, i dont know if thats something which you could use to build off

http://www.planetsourcecode.com/xq/ASP/txtCodeId.4992/lngWId.1/qx/vb/scripts/ShowCode.htm

hope this helps
Andy
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 3

Expert Comment

by:andysalih
ID: 6263946
0
 

Author Comment

by:Viki
ID: 6264072
let me make it clearer.
let say i have 3 field objects on a report.
then on runtime i wanna  add more fields objects to represent other new columns.
how do i add those objects?
i think it's equivalent to "createobject (textbox) " 
or loading a new textbox in array in VB.



0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7148211
Hi Viki,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept andysalih's comment(s) as an answer.

Viki, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Expert Comment

by:Computer101
ID: 7178953
Comment from expert accepted as answer

Computer101
E-E Moderator
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now