Jump to content

BIRT Developer Center Download


Photo
- - - - -

Passing multiple Int values into a 'drill through' parameter

Int value drill through parameter

  • Please log in to reply
12 replies to this topic

#1 CodeRookie

CodeRookie

    Senior Member

  • Members
  • 139 posts

Posted 21 April 2017 - 05:25 AM

Good morning, all!

 

Here's the problem I've run into:  I have a top level report that collects a number of 'heat_no' (Integer) values when run, and dumps the values into a parameter (heatNum).  This parameter does nothing other than collect data.

 

On the report table, I have a binding called 'Heats' that takes all of the values in the parameter, and combines them into a comma-separated string by using params["heatNum"].value.join(",").  I have second binding ('TEST') that is in the footer of the table just so I can see what values are captured.

 

Now, the main part of this report is a linear gauge gadget.  I have interactivity on, and I'm passing the value of row["Test"] to the drill report into a parameter (heatNo) that is an integer .  The problem I'm running into, is that I cannot for the life of me get the values being passed to work..... I can't seem to find the correct way to break the individual values out of the string, then put them back together as INT values so I can use them for WHERE heat_no IN (....) in my query for the second report.

 

Attached File  SalesDash8_COPY.rptdesign   25.62KB   1 downloads Main report

 

Attached File  casterMinutesDrillv5_4_COPY.rptdesign   98.54KB   1 downloads  Drill down

 

I'm attaching a copy of the main report, and the drill down.  If anyone could provide a hint as to how to do this, I would be most appreciative.  

 

Have a great day!

 

Scott

 

 


Scott Stanley

Business Analyst

North Star BlueScope Steel, LLC

 


#2 CodeRookie

CodeRookie

    Senior Member

  • Members
  • 139 posts

Posted 21 April 2017 - 06:24 AM

One thing I did notice, if I set a data binding equal to the params["heatNo"] of the second report,  set it to Integer, and throw it in the table, I get an output of:  [Ljava.lang.Object;@f31ac66

If I set the binding to Java Object, I get [214234, 214235, 214236]
which are the numbers I chose to pass in...... So, I suppose the data is getting passed, just not in the correct format.

 

Scott


Scott Stanley

Business Analyst

North Star BlueScope Steel, LLC

 


#3 pricher

pricher

    Senior Member

  • Members
  • 738 posts

Posted 21 April 2017 - 07:02 AM

Hi Scott,

 

I am sending you a example that works. TopReport has a parameter, pCustNum, similar to the one you created, i.e. multi-value list of integers. In the table, I have created a binding based on that parameter, custNum, using the same syntax you have. A hyperlink to BottomReport is created on custNum in the footer of the table. In BottomReport, the beforeOpen of the data set is used to modify the query using the .join() method to create a string from the array of integers passed to the report. (You can verify that it is an array passed to the report as I display the parameter on top of the table.) Now, I have also created a hyperlink directly on parameter pCustNum in TopReport. Notice that it works the same way, i.e. the values of the parameter are passed as an array of integers.

 

Hope this helps,

 

P.

Attached Files


Pierre Richer

Solutions Consultant, Analytics & Reporting

OpenText

 


#4 CodeRookie

CodeRookie

    Senior Member

  • Members
  • 139 posts

Posted 21 April 2017 - 07:05 AM

Pierre,

 

I can always count on you to come through!  I'll download the example, apply the principles to my reports, and get back to you with the results.

 

Thanks,

Scott


Scott Stanley

Business Analyst

North Star BlueScope Steel, LLC

 


#5 CodeRookie

CodeRookie

    Senior Member

  • Members
  • 139 posts

Posted 21 April 2017 - 09:48 AM

Pierre,

So, I followed your examples (mine were set up almost the same), and I get the values passed between the two reports, but the report doesn't spit out any data.  The interesting thing is, I get these three warnings in BRD Pro as the second report is running:

 

MESSAGE GetReportTOCTask: no TOC found fileName=/$$$Transient/acfile540.rptdocument nodeName=4.265100596239287

 

MESSAGE GetReportTOCTask: class com.actuate.reportapi.enginemanager.JREMException

 

com.actuate.reportapi.enginemanager.JREMException: Cannot get table of contents from file /$$$Transient/acfile540.rptdocument 4.265100596239287

 

Don't know if they are pointing to what the issue may be, but I figured I'd send them on.

 

Thanks,

Scott


Scott Stanley

Business Analyst

North Star BlueScope Steel, LLC

 


#6 CodeRookie

CodeRookie

    Senior Member

  • Members
  • 139 posts

Posted 21 April 2017 - 10:56 AM

Pierre,

I found the issue...... It was a data problem.  I was trying to pass all the heats at once, and once I knocked it down to the first two in the list, it worked fine.  So, now I just have to track down the data issue.

 

Thanks for your help, and have a great weekend!!!

 

Scott


Scott Stanley

Business Analyst

North Star BlueScope Steel, LLC

 


#7 pricher

pricher

    Senior Member

  • Members
  • 738 posts

Posted 21 April 2017 - 11:17 AM

Good to know!

 

P.


Pierre Richer

Solutions Consultant, Analytics & Reporting

OpenText

 


#8 CodeRookie

CodeRookie

    Senior Member

  • Members
  • 139 posts

Posted 24 April 2017 - 03:43 AM

Pierre,

 

Good morning!  Now that I know what my issue was with the report is, another question has surfaced.  How do I get the parameter to choose 'All' values passed from the data set as its default without any interaction by the user (I think I have an idea of how to do this, but just want to make sure)?  This report is actually a dashboard 'gadget' which only shows a linear gauge (no parameters are visible).  I'm only using said parameter to catch all heat numbers within the time frame of the report running to pass to the drill-down report.  While I was testing, I was actually selecting the values to pass.  Any thoughts?

 

Thanks,

Scott 


Scott Stanley

Business Analyst

North Star BlueScope Steel, LLC

 


#9 pricher

pricher

    Senior Member

  • Members
  • 738 posts

Posted 24 April 2017 - 05:47 AM

Hi Scott,

 

If you just want to pass a list of Heat Numbers from your gauge to the drill down report, you don't need a parameter. What you can do is create a Computed Column in the query that gives you the Heat Numbers that will concatenate all the heat numbers into one column. That column will be used as the value passed from the gauge to the drill-down report. 

 

In the attached example, I have create a computed column called "CustomerNumbers" in the query:

Attached File  2017-04-24 09_43_19-iHub 16 Demo Image - VMware Workstation.png   16.82KB   0 downloads

This gives me a list of all customer numbers in a comma-separated list:

Attached File  2017-04-24 09_44_41-iHub 16 Demo Image - VMware Workstation.png   19.63KB   0 downloads

That column is now used in the table for passing values to the drill-down report:

Attached File  2017-04-24 09_45_56-iHub 16 Demo Image - VMware Workstation.png   22.95KB   0 downloads

 

I have attached the sample report.

 

Hope this helps,

 

P.

Attached Files


Pierre Richer

Solutions Consultant, Analytics & Reporting

OpenText

 


#10 CodeRookie

CodeRookie

    Senior Member

  • Members
  • 139 posts

Posted 24 April 2017 - 06:13 AM

Pierre,

 

Thanks for the example!  Unfortunately, I had tried this as well, but the CONCATENATE is breaking my heat numbers into three digits each (they are currently six digits).  Is there a way to specify where it should place the "," to split the list up?

 

EDIT:  I did find this article:

 

http://developer.act...atting-numbers/

 

I'll give that a shot and see what happens.....

 

Thanks,

Scott


Scott Stanley

Business Analyst

North Star BlueScope Steel, LLC

 


#11 pricher

pricher

    Senior Member

  • Members
  • 738 posts

Posted 24 April 2017 - 07:53 AM

Interesting behavior that I did not know about...

 

Try the following syntax in the Expression of the computed column:

Formatter.format(row["heat_no"],"#")

It will remove the thousand separator commas.

 

P.


Pierre Richer

Solutions Consultant, Analytics & Reporting

OpenText

 


#12 CodeRookie

CodeRookie

    Senior Member

  • Members
  • 139 posts

Posted 24 April 2017 - 08:00 AM

Pierre,

 

That took care of the issue.  Thanks again for the help!

 

Scott


Scott Stanley

Business Analyst

North Star BlueScope Steel, LLC

 


#13 mblock

mblock

    Expert Member

  • BIRT Experts
  • 1884 posts

Posted 25 April 2017 - 07:25 AM

or use a different separator in the concat function.


Regards,

Mica J. Block

Principal Analytics Architect

OpenText Corporation






Also tagged with one or more of these keywords: Int value, drill through, parameter