This is a migrated thread and some comments may be shown as answers.

grabbing correct info from SQL database

3 Answers 83 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Amanda
Top achievements
Rank 2
Amanda asked on 19 Jun 2009, 01:58 PM
I have 3 tables that I need to pull information from for the report I'll be making (using Telerik Reporting). 
tblCWMods (fields ProjectID, Phase, JobName, Dealer, etc.), tblCWModItems (fields ProjectID, Phase, LetterID, Modification), and tblCWModFiles (fields ProjectID, Phase, LetterID, downloadName, description).  In my report I need the info from tblCWMods as the main part or grouping.  For each report there will only be one main group.  Within that, I may have several entries from tblCWModItems (related by ProjectID & Phase to tblCWMods) each having a unique LetterID.  Within those groups there may be several entries from tblCWModFiles (related by LetterID to tblCWModItems).  So my groups should be like this in the report:

ProjectID & Phase & JobName, etc (tblCWMods)
        LetterID & Modification (tblCWModItems)
                downloadName & description (tblCWModFiles)
        LetterID & Modification (tblCWModItems)
                downloadName & description (tblCWModFiles)


I'm just wondering how I would go about grabbing all this information from my sql database and then apply it to a new report.  I think I'm talking myself in circles on this one and have confused myself!!  :)   I'm using vb.net 2008 and I'm a beginner using Telerik Reporting.  So any information would definitely be appreciated!!  Please let me know if any other information is needed.  Thanks in advance.

3 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 23 Jun 2009, 09:24 AM
Hello Amanda,

As noted in our documentation, a report can be bound to a single table only. If you need to use data from other tables you can: Depending on how you choose to work with the data and what exactly you are trying to achieve, you can either have a separate subreport for each table or in case of inner join a single one.


Greetings,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Amanda
Top achievements
Rank 2
answered on 24 Jun 2009, 07:50 PM

I want to use the Join tables for the sql statement.  I think I may have it, this is what I'm using (approx.):

 

"Select CWM.*, CWMI.*, CWMF.* From DWJobInfo.dbo.tblCWMods as CWM Join DWJobInfo.dbo.tblCWModItems as CWMI On [CWM].ProjectID = [CWMI].ProjectID Join DWJobInfo.dbo.tblCWModFiles as CWMF on [CWMI].LetterID = [CWMF].LetterID WHERE [CWM].ProjectID = '"

 

& CWPhase.ProjectID & "' AND [CWM].Phase = '" & CWPhase.Name & "'"

If I get the correct info coming back, how would I create the report to copy what i have listed in my first post?  (Layout-wise)  I'm not sure how to do the groups or details sections.

 

0
Amanda
Top achievements
Rank 2
answered on 24 Jun 2009, 08:18 PM
okay actually i think i have the layout.  In the page header i have my main info and in a group i have LetterID and in that details section I have the files.  But, it seems that my SQL statement is not correct.  It's grabbing info, but not the correct stuff.  any ideas?
Tags
General Discussions
Asked by
Amanda
Top achievements
Rank 2
Answers by
Steve
Telerik team
Amanda
Top achievements
Rank 2
Share this question
or