Jump to content
We've recently updated our Privacy Statement, available here ×

cmatthews

Members
  • Posts

    57
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by cmatthews

  1. Another tip on this is in the band properties, "Split Allowed" will have impact on this sort of need. Sometimes the impact is desired sometimes not. There are several ways of making the output on page contain what you want. Report groups and band properties both have options which will help you control this.
  2. I think this is closer to what you are looking to accomplish. I attached a PDF and the template... Hope this helps, I added a subdataset, seemed appropriate but if not just unlink it from the chart. Good luck, Clark (may have gotten the grouping backwards...) let me know if you can't work it out. Post Edited by cmatthews at 07/12/2012 03:31
  3. Unfortunately the jasperforge servers aren't liking to let me download that sql, mind putting the contents into the "code" block in a post so I can properly copy/paste it. I'm getting this error wghen I try to download your file... ForbiddenYou don't have permission to access /uploads/forum/101/99428/salesample.sql on this server. Apache/2.2.3 (CentOS) Server at jasperforge.org Port 80
  4. Do you already end up with a list like, 1,2,3,4,5,6 Or is your list row based in the first place? I have dealt with this a number of ways and it depends on the format of the field that you are passing. Of course if you just pass '1,2,3,4,5,6' to the procedure with single quotes around it and your param is string type then it will be fine. Then I have some nifty functions that can make that comma seperated list into something more friendly for non-dynamic SQL use. I put a funciton in the code block that may be usefor for you. Code:CREATE FUNCTION [dbo].[ufn_ParseString2Table](@String VARCHAR(8000),@Delimiter VARCHAR(10) = ',')RETURNS @ReturnTable TABLE(Item VARCHAR(100))ASBEGIN/*Example:SELECT CONVERT(INT,ITEM) FROM dbo.ufn_ParseString2Table ('39, 549, 324, 3556, 24, 2132, 345 ,', ',') */WHILE CHARINDEX(@Delimiter,@String)>0BEGIN INSERT @ReturnTable SELECT SUBSTRING(@String,1,(CHARINDEX(@Delimiter,@String)-1)) SELECT @String=RIGHT(@String,DATALENGTH(@String)-CHARINDEX(@Delimiter,@String))ENDINSERT @ReturnTable SELECT @String RETURNEND
  5. Take a look at this, the problem is you want the series to be the same I think but the category to differ. I didn't make your tables and shove some sample data in to try it out but give this a try and see if it helps. Would make it easier on me to help if you need more help to also give me the create table statements for your source tables, easy enough for me to make them but would take me longer. I will put sample data in if you give me the CREATE TABLE statements. But try this first. Clark
  6. I mean the .JRXML file associated with your requirement, this way I can just load it up, make a few tweaks, and provide a copy back to you. If you aren't comfortable with that, it's okay ... in my opinion chart definition is easier explained by example.
  7. I posted an answer to how to accomplish this in theory. http://community.jaspersoft.com/questions/543296/dynamical-number-cols If this simply generates more questions please feel free to inquire further. Good luck, Clark
  8. I'm a bit confused myself .. but you shouldn't be replacing anything, you should be adding another series with the same category field and a new value field I believe? I may be confused though as I said. If you were to upload your template I might be able to mock it together for you, if you include the template and the create table statements for your involved tables it would be easier to show by example. Myself or someone may jump in then and be able to assist better. What you are trying to do should be possible though.
  9. Just some advice, I have found if you use report groups rather than bands when trying to include dynamic content and variable length content from subreports the pagination and blank space issues are much more easily controlled in a report group than a regular band. Play with that a bit and let us know if you are able to achieve what you want. Typically I may the report hight including all sections fixed at a full page then just lay things out int he sections appropriately. In some export formats, excel, and others, if you try to hide a band then the content is not visible but the space is still taken up, with groups this doesn't happen the same.
  10. I'm not sure I understand the problem, I do this a lot for standardized headers. You just make a report that you want to be the content of header, with a parameter used in the title. You pass the title paramter to the subreport and the rest is just whatever you define to be in the subreport header section. I usually have a few things, date range that the report is running against, title, report runtime / current date time, other notes / parameters / subtitle. Header supports subreport just fine. You will have to make one pass through all your reports to define this if you hadn't already started out that way. If you have experience with good searc and replace tools you may be able to script it in your jrxml files.
  11. Hey Murad, You should be able to get the current DB name and use it, or if your connection already has set the name shouldn't be needed at all. If I had to though... Could have a parent report and a sub report, parent report just gets the DB name, something like this in SQL Server, DECLARE @currentDBName VARCHAR(500) SELECT @currentDBName=DB_NAME() Then when you call the subreport pass the @currentDBName in as a parameter and use it in your query. SELECT * FROM $P!{currentDBName}.dbo.TableName But depending on server DB name context may be optional all together... Dunno for you but hope this help some more. Clark
  12. Hi, I recently answered a question that is very similar to your need. You may be able to use the solution posted here to apply it to your problem. http://community.jaspersoft.com/questions/543126/variable-having-count-values-need-count-field-1-234 If not, let me know, I'll try to give you some details specific to your situation.
  13. If your not doing it in java code then the way I have done this is with parameters and subreports. Your sql statement should have something like this, IF ($P!{numberOfCols} = 4) BEGIN SELECT $P!{columnOne} as columnOne, $P!{columnTwo} as columnTwo, $P!{columnThree} as columnThree, $P!{columnFour} as columnFour FROM sourceTable END In my edit I added the "as columnOne", I realized that is part of the key to solving for your need. This way the report doesn't care what you actually put in columnOne so long as the type is correct. I recommend using string for everything. You just call the subreport that will result in the correct column number, you could do this several ways but a couple ideas, have subreports for each column count depth and call the one that equals the column count. Or ... make one as wide as the greatest width of columns and set all the extra columns to null and use the option "blank when null". For the column headers you can have a variable declaration that would set the column headers text dynamically. Something like this, ( $P{columnOne},equals("addressColumn") ) ? "Address" : $P{columnOne},equals("firstNameColumn") ) ? "First Name" : "" etc, etc, until all the possibiltiies are met. Hope this helps set you in a direction.. Clark Post Edited by cmatthews at 07/09/2012 16:30
  14. If your using SQL as a data source, which flavor and version? This sort of thing is much easier to do in the data query. Whats a sample of your source data look like?
  15. I think it's because that TTF font isn't in the ext or lib folder on your web server. At least that is why I have previosuly seen that error when deploying a report with a new font used in it.
  16. I'd like to help more but would need to see the data structures with a little more detail. Sounds like you want a couple fields appended to each other but it is a different thing if you are trying to do this same logic with multiple rows, and it's dependant on the DB and version which features may be available. Which DB flavor and version are you using and what does a simple peek at the data look like? In mySQL there is a command GROUP_CONCAT ... In SQL Server you could do something like what I put in the code section. I use the sample in Liferay in order to get a list of the users accesible organizations in sql. Code: DECLARE @strList VARCHAR(4000) SELECT @strList = COALESCE(@strList + ', ', '') + (list.name) FROM ( SELECT usersOrgs.organizationId,sysOrgs.name FROM LPORTAL.dbo.Users_Orgs userOrgs INNER JOIN LPORTAL.dbo.Organization_ sysOrgs ON sysOrgs.organizationid = userOrgs.organizationid WHERE userId = @userId ) list SELECT @strList Post Edited by cmatthews at 07/09/2012 01:57
  17. Refer to this stuff, This one shows how to get a string converted into a date object http://www.roseindia.net/java/java-conversion/StringToDate.shtml This one shows how to do the math between the two dates http://www.roseindia.net/java/java-get-example/number-days-between.shtml Hope this helps, Clark
  18. It's a report context sensative question ... And there are several ways to solve for this one, but I'll take a stab at it, based on your sample it looks like you know your going to have a certain maximum number of those values to count, in your sample it was up to 4, so assuming it's 4 you could use four variables to count the numbers and set the variables on a row level to either 0 or 1. $V{countOfOnes} $V{countOfTwos} $V{countOfThrees} $V{countOfFours} Now you have a variable expression where you set the resulting value of the variable to either 0 or 1 based on the rows value. Put this code in the $V{countOfOnes} variable and place it on the row (set the print when expression = Boolean.FALSE so it doesn't ever show this on the report) ($F{count}.intValue() == 1) ? 1 : 0 Then create a sum variable in the appropriate summary band as needed for each of the countOf##### variables. Should result in a sum represending the count of each type, once you have that you can format it in output however you like. Just for a little more clarification, each one of the variables "countOfOnes, countOfTwos" etc should have the appropriate equal check, $V{countOfOnes} with expression = ($F{count}.intValue() == 1) ? 1 : 0 $V{countOfTwos} with expression = ($F{count}.intValue() == 2) ? 1 : 0 $V{countOfThrees} with expression = ($F{count}.intValue() == 3) ? 1 : 0 $V{countOfFours} with expression = ($F{count}.intValue() == 4) ? 1 : 0 etc, etc.Good luck, Clark Post Edited by cmatthews at 07/08/2012 22:29
  19. Sounds like a bit of an odd problem, usually people asking about wanting the header and footer only on the first page, you sure you don't have the "Ignore Pagination" turned on in the report properties? That would be the only reason I can think of besides using the "Print When Expression" on the band. Maybe try and put this in the bands "Print When Expression", Boolean.TRUE Besides ignoring pagination and this ... shrug. Good luck, Clark
  20. It is possible but you need to do some work in java/jsp, you can have the users provided data source uploaded to some known location that is used as the datasource property in jasperreports. I don't think there is an inherent method that supports the required need but it is completely do-able with some code and known constants. Clark
  21. I use them all the time, should work without any extra effort. EXEC DBNAME.owner.usp_ShowSomething '$P!{someParameter}' No out parameter should be needed, whatever your final select is in the procedure should be available to jasper/ireport as data. The simple sample SP I put in the code section works for me, Code:CREATE PROCEDURE usp_ShowSomething @someParameter VARCHAR(MAX)ASBEGIN SET NOCOUNT ON SELECT 'This should show your parameter: ' as column1, @someParameter as column2END
  22. Couple tips that may help, iReport-4.5.1\ireport\modules\ext Should work with the JDBC JAR files in that folder, you may have to define the entire JDBC URL connection string without the driver actually showing in the drop down, So throw this in the connection string, jdbc:rbw:protocol:[{ip-address|host-name}:port-number][/dbName/][?UID=user&PWD=password][&name=value] And define the sections accordingly. If it still doesn't work maybe some other problem with your ireport implementation but another sledgehammer style hit you can make to ensuring the JDBC driver is discoverable by java/jasperreports is to throw the JARS in the Java\jre6\lib\ext folder of your java installation... It's not really the best thing to do but for testing why the driver is failing it should help you ... Good luck, Clark
  23. All your parameters in the query expression section need to contain a bang " ! ". You don't use the bang much elsewhere but this is what tells the report engine to do what you want in the report query. You need it throughout your query but ... here is a small sample of what needs updating. group by case when upper($P!{Date_Type})= 'Y' then to_char(enqh.enqr_date_time,'YYYY') when upper($P!{Date_Type})= 'Q' then to_char(enqh.enqr_date_time,'Q')||to_char(enqh.enqr_date_time,'YYYY') when upper($P!{Date_Type})= 'M' then to_char(enqh.enqr_date_time,'MON')||to_char(enqh.enqr_date_time,'YYYY') when upper($P!{Date_Type})= 'W' then to_char(enqh.enqr_date_time,'WW')||to_char(enqh.enqr_date_time,'YYYY') when upper($P!{Date_Type})= 'D' then to_char(enqh.enqr_date_time, 'DD-MON-YYYY') end Good luck, Clark
  24. Yes, this is a practical concept that the jasper reports feature set is capable of delivering a solution against. It is a somewhat complicated question and cannot really be answered with a 100% solution in a forum response but it is simple enough if you have the skills to setup a routine that would take in some sort of itenerary identifier and and email address and automate the transmit of an email with a PDF attachment. I do this sort of thing all the time with the jasper reports engine and the ireport designer and a little java code. Hope this starts you on your way. Clark
×
×
  • Create New...