Solved

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

Posted on 2001-07-08
7
223 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

777 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