Showing posts with label bill. Show all posts
Showing posts with label bill. Show all posts

Sunday, March 25, 2012

Crystal Subreports problem

I could use some help very badly with subreports. I am looking up Bill of Materials part numbers. I have a report that shows the Assembly_Part_Numbers, Component_Part_Numbers, and some other fields. Now, assemblies such as pc boards, cable assemblies, frame assemblies, etc., may comtain components, e.g. - (Component_Part_Numbers) which are themselves assemblies as well. They may be cable subassemblies, daughter boards, etc. If a Component_Part_Number also is listed in the Assembly_Part_Numbers then it is a sub-assembly. I need to be able to show the component parts of these separately, as well.

Now, on the main report I group by Assembly_Part_Number then sort the group by Component_Part_Number. This listing is perfect. But I am having a really hard time figuring out how to do the subreport, or drill-down report. I want the user to be able to click or double-click on a Component_Part_Number listed and, if it is a sub-assembly, display a subreport showing all the components of the sub-assembly. Also, I need to be able to print these out, as well.

Can anybody point me in the right direction? I tried it myself and came up with a very ugly report. I've been using Crystal for over eight years, but have never needed to do a subreport before.

Thanks,
Michael FoxHave you tried Hierarchical Grouping Options in Report menu? This will allow you to establish recursive relation by specifying Instance ID and Parent ID, so the entire tree structure of your assemblies will be displayed. I am not sure, however, if it is possible to actually drill-down into the tree. I tend to think it is not possible, and you would need some frontend application to catch user clicks and re-display the report with selected data.

Subreport is not your friend in this case, because subreport is not recursive (can't have one subreport inside another one).

Friday, February 24, 2012

Crosstab Query

I have two tables Bill and Location.
Bill
(
location_id int,
prod_period datetime,
consumption float,
demand float
)

Location
(
location_id int,
location_name varchar(45)
)

I want to create a stored procedure that takes a parameter of @.year. I
basically want the procedure to return results that show locations
where consumption and/or demand IS NULL or 0 for each month throughout
a given year. I would like my results to look something like this:

location_id year Jan Feb Mar Apr May Jun Jul Aug Sept Oct
Nov Dec
1 2005 0 0 0
2 2005 0 0 0 0
3 2005 0 0

If data does exist for consumption or demand, I would like to show it,
however I am really interested in the locations that have no data
associated with them.

Any ideas of how I can accomplish this?Hi

There are many posts on Crosstab queries, usually the fastest solution is to
use the client side tools to produce this. You may also want to check out
http://www.windowsitpro.com/SQLServ...5608/15608.html.

John

<burke.david@.gmail.com> wrote in message
news:1126090825.869267.236710@.g47g2000cwa.googlegr oups.com...
>I have two tables Bill and Location.
> Bill
> (
> location_id int,
> prod_period datetime,
> consumption float,
> demand float
> )
> Location
> (
> location_id int,
> location_name varchar(45)
> )
> I want to create a stored procedure that takes a parameter of @.year. I
> basically want the procedure to return results that show locations
> where consumption and/or demand IS NULL or 0 for each month throughout
> a given year. I would like my results to look something like this:
> location_id year Jan Feb Mar Apr May Jun Jul Aug Sept Oct
> Nov Dec
> 1 2005 0 0 0
> 2 2005 0 0 0 0
> 3 2005 0 0
> If data does exist for consumption or demand, I would like to show it,
> however I am really interested in the locations that have no data
> associated with them.
> Any ideas of how I can accomplish this?