Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Not sure how to Post Reply Post New Topic
Page  of 3 Next >>
Author Message
Shawnlo
Newbie
Newbie


Joined: 24 May 2011
Location: Canada
Online Status: Offline
Posts: 22
Quote Shawnlo Replybullet Topic: Not sure how to
    Posted: 25 May 2011 at 4:17am
I am in the process of creating a report if I use the following select statement I get the desired results
 
{STOREDGRADES.COURSE_NUMBER} like "*LA*" and
{STOREDGRADES.STORECODE} = {?My Parameter} and
{STUDENTS.LAST_NAME} = {?LastName} and
{STANDARDS.IDENTIFIER} like "*LA*"
 
However my problem comes in as I need multiple selections of the same data such as the following, so I need LA, Math, Science etc to follow.
 
{STOREDGRADES.COURSE_NUMBER} like "*MA*" and
{STOREDGRADES.STORECODE} = {?TermID} and
{STUDENTS.LAST_NAME} = {?LastName} and
{STANDARDS.IDENTIFIER} like "*MA*"
 
I tried creating a sub report, I might be doing something wrong, I ended up getting 160 records back for each subreport as it parsed the database.  The code alone works only showing the 2 results which is what I want.  However I need multiple instances of the same but different data.
 
My SQL statement is:
 
 SELECT "STUDENTS"."FIRST_NAME", "STUDENTS"."LAST_NAME", "STUDENTS"."GRADE_LEVEL", "STOREDGRADES"."STORECODE", "STOREDGRADES"."TEACHER_NAME", "STOREDGRADES"."COURSE_NUMBER", "STANDARDSGRADES"."TRANSAVERAGESCORE", "STANDARDS"."NAME", "STANDARDS"."IDENTIFIER"
 FROM   (("PS"."STUDENTS" "STUDENTS" LEFT OUTER JOIN "PS"."STOREDGRADES" "STOREDGRADES" ON "STUDENTS"."ID"="STOREDGRADES"."STUDENTID") LEFT OUTER JOIN "PS"."STANDARDSGRADES" "STANDARDSGRADES" ON "STUDENTS"."ID"="STANDARDSGRADES"."STUDENTID") LEFT OUTER JOIN "PS"."STANDARDS" "STANDARDS" ON "STANDARDSGRADES"."STANDARDSID"="STANDARDS"."ID"
 WHERE  "STOREDGRADES"."COURSE_NUMBER" LIKE '%LA%' AND "STOREDGRADES"."STORECODE"='T1' AND "STUDENTS"."LAST_NAME"='SOMELASTNAME' AND "STANDARDS"."IDENTIFIER" LIKE '%LA%'
 
Maybe I am thinking wrong in trying to use sub reports, any direction would be greatly appreciated. 
 
Thank you
Shawn


Edited by Shawnlo - 27 May 2011 at 5:26am
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 25 May 2011 at 4:32am
Draft a sample of how your report should look. It may not be necessary to use subreports, although subreports would definitely do the trick.

In particular, how should each course appear on the report, any grouping, etc.

A subreport is just a report that's embedded in another report.

If you are using selection formulas to filter results, then you will have to write one for the subreport as well. Or somehow filter out unwanted records.

Edited by Keikoku - 25 May 2011 at 4:34am
IP IP Logged
Shawnlo
Newbie
Newbie


Joined: 24 May 2011
Location: Canada
Online Status: Offline
Posts: 22
Quote Shawnlo Replybullet Posted: 25 May 2011 at 6:24am
I would love to not use subreports I just don't know how I would filter the data I want. 
 
I have a mockup of what the report should look like.  What I find interesting is if I run the sub report seperatly it displays The 2 items I want only 1 time.  When I add it as a subreport it displays the 2 items I want 160 times.  Have been playing with linking trying to figure out if that's where my issue is.  I am using parameters if that makes a diffrence.
 
When you say write a selection to filter the subereport, do you mean in the master, or the sub report itself?  If it's the subreport I am filtering, and that works in a standalone report. 
 
If it's the Master I am unsure how to do that.
 
 
Thank you
Shawn
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 25 May 2011 at 6:59am
How do you want your report to look?

I am not sure what you mean by "multiple selections of the same data" as they are different sets of data since the course number is different.

I'm also not too sure why it would display many times as I haven't worked with subreports that much.
IP IP Logged
Shawnlo
Newbie
Newbie


Joined: 24 May 2011
Location: Canada
Online Status: Offline
Posts: 22
Quote Shawnlo Replybullet Posted: 25 May 2011 at 7:12am
I think the issue with displaying many times may have to do with grouping, when I create a group, and pull the sub reports into that group I get almost what I am looking for however it also adds 55 blank pages.
 
What I want to do with the data which your right is different is pull something like:
 
Term1  Course Name  (such as LA)
Teacher Name
Reading Score
Writing Score
Comments
 
Then repeat for the next subject and so on
 
Term1  Course Name  (such as Social)
Teacher Name
Reading Score
Writing Score
Comments
 
One of my thoughts is it would be perfect if I could loop through an array that looked at the standards.identifier and storedgrades.course_number tables.
 
Thank you so much for your help I really do appreciate it.
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 25 May 2011 at 9:14am
The report can be easily generated using detail sections since you are simply repeating each block for different courses and relevant information for that course.

So I would focus on trying to write the query so that everything you need for a single course is available in a single record.

That is, suppose you have a course code 123MA, and your record looks like


123MA, Mr.Math, A, A, "some arbitrary comment regarding student's excellent performance"


If you're able to get that kind of record, then it is a matter of placing the fields and inserting some text fields.

Edited by Keikoku - 25 May 2011 at 9:16am
IP IP Logged
Shawnlo
Newbie
Newbie


Joined: 24 May 2011
Location: Canada
Online Status: Offline
Posts: 22
Quote Shawnlo Replybullet Posted: 25 May 2011 at 1:52pm
So one of the things I have tried is taking a step back and might be working is using the following in a selection:
 
{STOREDGRADES.COURSE_NUMBER} like "*LA*" and
{STOREDGRADES.STORECODE} = {?My Parameter} and
{STUDENTS.LAST_NAME} = {?LastName} and
{STANDARDS.IDENTIFIER} like "*LA*"
or
{STOREDGRADES.COURSE_NUMBER} like "*MA*" and
{STOREDGRADES.STORECODE} = {?My Parameter} and
{STUDENTS.LAST_NAME} = {?LastName} and
{STANDARDS.IDENTIFIER} like "*MA*"
or
{STOREDGRADES.COURSE_NUMBER} like "*SS*" and
{STOREDGRADES.STORECODE} = {?My Parameter} and
{STUDENTS.LAST_NAME} = {?LastName} and
{STANDARDS.IDENTIFIER} like "*SS*"
 
Hoping this might give a better idea of how I have to pull the data.
IP IP Logged
CircleD
Senior Member
Senior Member
Avatar

Joined: 11 Mar 2011
Location: United States
Online Status: Offline
Posts: 251
Quote CircleD Replybullet Posted: 25 May 2011 at 6:19pm
Have you tried simply placing the fields in the order you want them to print in the details section and then group by Name and sort by Course and under the Group Options checking the box "New Page After" option?This should print everything you want with a new page for each student if this is supposed to be like a report card,if not then you can leave the "New page After" unchecked.You probably won't be able to stack them like you show but seperate the columns like Keikoku shows in his example.
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 26 May 2011 at 2:51am
As long as all of the data is available in a single record, the report can be formatted to be stacked that way since it is just placing a lot of text fields in the detail section.
IP IP Logged
Shawnlo
Newbie
Newbie


Joined: 24 May 2011
Location: Canada
Online Status: Offline
Posts: 22
Quote Shawnlo Replybullet Posted: 26 May 2011 at 4:29am
Grouping is exactly what I want, however I still would need to filter the reuslts in each course grouping as I get back multiple records.
 
  The Data is coming from 4 seperate tables linked together, and at least 2 fields in each table.
IP IP Logged
Page  of 3 Next >>
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.