Bonjour à tous !

Question je pense assez simple, j'ai une bdd sql server 2008 avec 3 tables.
Lors de mon premier test (je suis nouveau dans CR) j'ai mis toutes les tables dans le rapport. Même en retirant les liens, il me mixe les données bizarrement.

J'en ai conclut qu'il fallait passer par des sous états.
J'ai donc inclut un état, dans mon rapport principal.

Quand je lance le site, le rapport principal s'affiche, il contient bien les noms de colonnes du sous rapport, mais aucune données ne s'affichent...

Avec mon premier rapport j'envoyais les données dans le page load, de cette façon:

Dim ds AS New DataSet1()
        Dim da AS New DataSet1TableAdapters.BilanMatieresTableAdapter()
        Dim da2 AS New DataSet1TableAdapters.BilanPesageTableAdapter()
        Dim da3 AS New DataSet1TableAdapters.BilanZingageTableAdapter()
 
        da.Fill(ds.BilanMatieres)
        da2.Fill(ds.BilanPesage)
        da3.fill(ds.bilanzingage)
 
        CrystalReportSource1.ReportDocument.SetDataSource(ds)

Avec un rapport vide contenant un sous rapport, si je lance l'application avec ce même code, il y a une erreur me disant que "le rapport ne contient aucune table". Certes, il a juste un sous rapport.

J'ai donc retiré ces lignes, et j'obtiens mon rapport avec le sous rapport n'ayant que des noms de colonnes.

Je suspecte qu'il n'a donc pas de source de données, mais comment lui passer ?
Il n'y a pas de report.subreport.setDataSource =/

J'espère que mon problème est bien expliqué, et que vous saurez m'aider ! :S

Merci !

-- Sorry for the double post, but I don't see any edit function. And I kinda didn't notice it was an english forum when I wrote that D: --

--Anyway : translated version : --

Hi everyone

I have a question that is probably simpe : I have an sql server 2008 db with 3 tables.
During my first test (I'm new to CR) I inserted every tables in the report.
But even I removed the links, he seems to be weirdly mixing the data.

I concluded that what I need is to use sub-reports. In that way, I included a report which contain 1 table, in my main report.

When I launch the website, the report is drawn, but it oonly contains header names, no data.

This is the code I used on my first report (3 tables/no subs) to send the data:

Dim ds AS New DataSet1()
        Dim da AS New DataSet1TableAdapters.BilanMatieresTableAdapter()
        Dim da2 AS New DataSet1TableAdapters.BilanPesageTableAdapter()
        Dim da3 AS New DataSet1TableAdapters.BilanZingageTableAdapter()
 
        da.Fill(ds.BilanMatieres)
        da2.Fill(ds.BilanPesage)
        da3.fill(ds.bilanzingage)
 
        CrystalReportSource1.ReportDocument.SetDataSource(ds)

However, if I try to do that with a main report empty + 1 sub report; I get this error:
"the report contains no tables". Well, yeah. There's just a sub report.

So I removed this code, and then I get the report I was talking before : only header names.

I think that it's because I don't send him data, but how can i give him ?
There's no "report.subreport.datasource" =/

Anyway, I hope I was clear and that you can help me ! :S

Thanks.

------------------

During the period I posted this and now, I understood that by inserting the subreport inside the "details" section, CR is trying to search the data of this table, corresponding to each line of the table in the main report, like :

Customer
Order
Orderb
Customerb
Order
...

Where customer is table 1 and orders are from subreport.

Due to the fact I have no table in the main report, I suppose it's normal I have nothing.

So I may make all my post in 1 simple question: How do I make a report, containing like 6 tables, with absolutely no link between them, if it's not by making 6 sub reports ?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.