Print Page | Close Window

crystal report 2005

Printed From: Crystal Reports Book
Category: General Information
Forum Name: Talk with the Author
Forum Discription: Ask Brian questions about his books and give him your comments. Like the book? Hate the book? Have suggestions? Let me know!
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=742
Printed Date: 03 May 2024 at 6:16am


Topic: crystal report 2005
Posted By: hosam
Subject: crystal report 2005
Date Posted: 24 May 2007 at 2:31am
hi
how r u
i've a great problem that can't be solved until now by crystal report
 
i'm creating a control program for exam results
the table of the result is created dynamically by code
the table name i don't know
ex  the table created like this
      courseResult_facName_deptName_Year
 
so i don't know the facName , deptName anf year
      so i can not specify a table source for the dataset
 
i hope you understand me
 
2- the colmns in this dynamic table that generated by code i don't know too
 
i hope u understand me
i want u to solve me this problem



Replies:
Posted By: hilfy
Date Posted: 24 May 2007 at 10:58am
The table name issue can be handled fairly in code.  However, if the columns are not "standard" (e.g., always the same) there's no way that I know of to actually dynamically create the report in code based on the structure of the table you're given at run time.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: hosam
Date Posted: 26 May 2007 at 10:27pm
thnx the table name i solve it by still the colmn names which i don't know still cann't be solved
is there any way to get from dataView c# 2005 to crystal report directly


Posted By: hilfy
Date Posted: 28 May 2007 at 11:54am
The only way I know of only works if you know what your columns are whey you're designing the report.  I don't know of any reasonable way to design the report "on the fly" with a dynamic data source.
 
One way I've gotten around this in the past is to set up a generic dataset in an appliction.  There are two tables with the following structures:
 
Report_Headers
Column1_Header     string
Column2_Header     string
...
ColumnN_Header     string
 
Report_Data
Column1                   string
Column2                   string
Column3                   string
...
ColumnN                   string
 
Where N is the maximumn number of columns you'll ever display on the report.  All data is converted to a string format and places in the Report_Data table in the order in which it will be displayed on the report.  The corresponding column headers are placed in the Report_Header table.  Columns are left empty if there is no data.  You then design a report around this dataset.
 
However, I'm not sure that this method would work for you because your data is actually generated by code that you don't know and may not have access to.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics



Print Page | Close Window