codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
This 42 message thread spans 3 pages: [1]  2   3  > >  
  dynamic crystal report generation  puneetshadija at 05:29 on Thursday, February 10, 2005
 

well i am a beginner at vb.net and has got stuck with a problem where i have to generate datatable dynamically and feedit into crystal report as a source.
i hve been able to build the data table but i dont know how to provide this data table tht i have generated as the input to the crystal report.
pease help me!
puneet shadija

  Re: dynamic crystal report generation  raik at 06:29 on Friday, March 18, 2005
 

Folllow the below steps.

1- Create a crystal report template(Add =>Add New Item => Crystal Report

2- Drop Crystalreportviewer control on from from toolbox.

3-do needful to create commandtext of commandbutton (select those fields which u specify in template)

4-And then assosiate ur commandtext with Crystalreportviewer.selectformula

i hope it will work fine


  Re: dynamic crystal report generation  puneetshadija at 16:33 on Friday, March 18, 2005
 

sir,
thanx for responding but my need is such that i dont have any fixed structure for the table... which is the datasource for my report. the choice made by the user defines the structure at the run time and the data is then filled into it. So, i need the API using which i can define the structure of the data to be shown at run time and put data which is there in my table into the detail section.
hoping for a positive response.
thank you


  Re: dynamic crystal report generation  saboovineet1 at 07:31 on Monday, May 09, 2005
 

Have u got any solution, i have same problem

  Re: dynamic crystal report generation  Ogbes at 07:11 on Monday, June 27, 2005
 

I have been trying to findmout how to generate a dynamic report in visual basic. I know how to design a database program and use crystal report or data report with dataenvironment. Really this does little compared to what i want. What i need is that when a user select the fields he/she wants to use or see i want those fields alone to be reported in the crystal report or data report. That is what i have been trying to find out. Please kindly help me if you can.

  Re: dynamic crystal report generation  puneetshadija at 09:53 on Monday, June 27, 2005
 

dear,
i haven't got answere to the problem i have mentioned above;
But the problem u are talking about if a lot different (if i was able to get it right!!!), what are the type of fields that you have and are those fields fixed in number... it would be better if u can give more explanations regarding your problem.

  Re: dynamic crystal report generation  saboovineet1 at 11:38 on Monday, June 27, 2005
 

The dynamic report can be generated only using Formula Fields. i m using Crystal reports 10.0. Just add few formula fields into details section of the report. Now through VB or VB.NET, we can access Report's Formula Fields Array. The instance of the Report (.rpt) has a property "FormulaFields" as Array of the formula fields on the report, we can assign column names of a datatble to the FormulaField(index).Text property to have dynamically those columns onto the report.
The syntax will be:
ReportInstance.DataDefinition.FormulaFields(index).Text = "{DataTable.ColumnName}"

For Eg:

SalaryReport.DataDefinition.FormulaFields(0).Text = "{EmployeeSalaryTable.Sal}"

Thus the first formula field, that is added to the details section in report, will dhow the salary details.

  Re: dynamic crystal report generation  jagdish_ce at 04:58 on Thursday, June 30, 2005
 

Hi,

Dynamically, I have to bind XML file with crystal Report in c#.net.

If any body knows then let me know its very urgent.



  Re: dynamic crystal report generation  ajay_mittal at 06:19 on Wednesday, August 24, 2005
 

Hello,
Thanks for ur code but it does not work for string. If we pass a string to any formula, it does not work.

  Re: dynamic crystal report generation  swapna_1184 at 05:58 on Wednesday, September 21, 2005
 

gfhgjnfg

  Re: dynamic crystal report generation  llama at 12:46 on Tuesday, October 04, 2005
 

If you want to pass an actual string just add ' ' around the text. ex :
SalaryReport.DataDefinition.FormulaFields(0).Text = "'passing this text'"

  Re: dynamic crystal report generation  jocey014 at 10:15 on Friday, October 14, 2005
 

I'm very much new in vb most esp. with crystal reports. i'm creating a sort of report wizard wherein i need to create reports depending on the parameters or fields chosen by the user. What i want to do is to create reports dynamically, wherein my DATA SOURCE may be ALTERED , depending in the user. It's like a table with N-number of fields. I would really appreciate any help you could give. Thank you.


  Re: dynamic crystal report generation  jocey014 at 10:24 on Friday, October 14, 2005
 

What if i dont have an exact number of fields? Will the formula fields work? Thanx


  Re: dynamic crystal report generation  llama at 13:03 on Friday, October 14, 2005
 

No you'll need either the number or the name of the feild itself.

you can loop throught all your feild and getting the feild name using the ReportInstance.DataDefinition.FormulaFields(0).Name command

ex:
Dim myFormulaField As CrystalDecisions.CrystalReports.Engine.FormulaFieldDefinition
Dim myName As String
For Each myFormulaField In ReportInstance.DataDefinition.FormulaFields
myName = myFormulaField.Name
... do what you want
Next

or you can type

ReportInstance.DataDefinition.FormulaFields("feildname").text = "'passed in'"
but make sure you have the correct feild name. For the dynamic report generation you could pass a dataset to the report all you have to do different is instead of connecting the report to a database you assign it a dataset in .Net "ReportInstance.SetDataSource(myDataSet)" . Another way if you prefer is to create a temporary table that you will use for your reports.

  Re: dynamic crystal report generation  jocey014 at 08:23 on Monday, October 17, 2005
 

Thank you very much for the reply... I tried creating a temporary table. i'm using VB 6.0 and Crystal 6. I created a <.ttx> table using Data Definitions and i have transferred ol fields that i'll be needing. My problem is i have no exact number of fields to view on my report. It leaves me to creating so many temporary fields, assuming the maximum number of fields on my report. Can i design my temporary table during runtime? Thank you...

This 42 message thread spans 3 pages: [1]  2   3  > >  







CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Ajax example: online chat
•  Re: Nested Javascripts
•  ISP says linefeeds are causing problems
•  Linker Error Unresolved External Borland Builder 2006
•  Have multiple ASP.NET web projects share pages and controls
•  Re: How can I read ASCII data file in C++
•  Trouble writing programs
•  Validation Problem
•  Date formating from user input


Recent Articles
What is a pointer in C?
Multiple submit buttons with form validation
Understanding Hibernate ORM for Java/J2EE
HTTP screen-scraping and caching
a javascript calculator
A simple way to JTable
Java Native Interface (JNI)
Parsing Dynamic Layouts
MagicGrid
Caching With ASP.Net


© Copyright codetoad.com 2001-2006