Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CR10 RAS: use an old report for creating a new one / no joins in SQL

Status
Not open for further replies.

widdi

Programmer
Sep 1, 2004
1
DE
Hi,

I'm programming a webtool with C#.

I load reports from RAS-server into a reportClientDocument. From that Document I read the information of connection (e.g. SQL, ODBC), used tables, fields, groups, sorts,.. and change them. I store these informations in an own class.

Then I have different asp-pages, on that I change the informations. This changes, are stored in the classobject.

At the end I create a new report. Therefore I use a new clientReportDocument, where I set the informations, I've stored in my class.

It works. I get a report - but: the SQL-statement is not build up correctly. If I have different tables in my query, I get a sql-statement for each table. In the end I get something like table1*table2*table3. I get too many datasets.
Crystal will not use the informations from
===
TableLink tl = new TableLinkClass();
foreach (object[] tableLink in dro.TableLinks)
{
tl.JoinType = CrystalDecisions.ReportAppServer.DataDefModel.CrTableJoinTypeEnum) tableLink[0];
tl.SourceFieldNames =(CrystalDecisions.ReportAppServer.DataDefModel.Strings) tableLink[1];
tl.SourceTableAlias = tableLink[2].ToString();
tl.TargetFieldNames = CrystalDecisions.ReportAppServer.DataDefModel.Strings) tableLink[3];
tl.TargetTableAlias = tableLink[4].ToString();
reportClientDocument.DataDefController.Database.TableLinks.Add(tl);
}

===
to build up _one_ sql-statement with joins between the tables.

There exists on the Database.* also "TableJoins". There I never found informations. The information about the links is stored in the tl.TargetFieldNames and tl.SourceFieldNames

I have no idea, whats wrong. Filling the reportClientDocument:
- setting connection
- adding tablelinks
- adding fields
- adding groups
- adding sort

at the end I assign a reporttemplate and show the report. This works fine. Groups and sortings will be shown. But in

reportClientDocument.RowsetController.GetSQLStatement(null,out outString);

I get several sql strings instead of one string :-(
What information have I forgotten to take from the old report or what hav I to set, that the statement will be build corrdctly?

thanks for helping
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top