Jump to content
Changes to the Jaspersoft community edition download ×

camnott

Members
  • Posts

    25
  • Joined

  • Last visited

camnott's Achievements

Contributor

Contributor (5/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Collaborator Rare

Recent Badges

0

Reputation

3

Community Answers

  1. Actually found my own way to get around this. Added new parameters p_connection p_user p_password and changed the expression to java.sql.DriverManager.getConnection($P{p_connection},$P{p_user},$P{p_password}) Works perfectly.
  2. Hello, I have a report that uses several connections to pull data. The issue I am running into is this : When one of the connections fails, it shows an error in AdvancedReporting that shows the connection expression, including password.... java.sql.DriverManager.getConnection("jdbc:db2://server/database","username","password") How can I stop this from showing on error, or at least blank out the expression? This is a fairly significant security breach... Not sure why it would show the entire expression. Thank you.
  3. Hello, I need help with a subreport connection. I have a main report using a different data source, and am trying to connect via connection expression as follows : java.sql.DriverManager.getConnection("jdbc:db2://hostname/db", "username", "password") When I am in jaspersoft studio, it seems to work, at least the query functions... However, from Clarity Advanced Report I keep getting : "Error when evaluation expression: java.sql.DriverManager.getConnection("jdbc:db2://hostname/db", "username", "password")" I really need to get this worked out, as I have used something similar in the past... not sure why this is not working in Clarity. Thank you!
  4. I have a subreport that is working fine by itself, but when I try to run the main report, I get an error... Here is the connection expression : java.sql.DriverManager.getConnection("jdbc:db2://hostname/db", "username", "password") I have been trying to get this to work all day... the error I receive is : Cannot evaluate expression : java.sql.DriverManager.getConnection("jdbc:db2://hostname/db", "username", "password") Any help would be appreciated.
  5. Hello, I created a new report in JasperSoft Studio (Which runs perfectly fine in preview mode, and in SQL Server Management Studio).. However, I get an error when trying to run from Clarity Advanced Reporting. Here is part of the Query that I believe is causing the issue (Removed rest due to containing secured information) : SET NOCOUNT ONDECLARE @start_date date = 'Jan 1, 2011';DECLARE @end_date date = dateadd(year,40,@start_date);DECLARE @Nwkdy as Table (dtday DATE);WITH AllDays AS ( SELECT @start_date AS DtDay , MONTH(@start_date) as mnth , DAY(@start_date) as dayofM , DATENAME(weekday, @start_date) as dtname UNION ALL SELECT DATEADD(DAY, 1, DtDay) , MONTH(DATEADD(DAY, 1, DtDay)) as mnth , DAY(DATEADD(DAY, 1, DtDay)) as dayofM , DATENAME(weekday,DATEADD(DAY, 1, DtDay)) as dtname FROM AllDays WHERE DtDay < @end_date )INSERT INTO @Nwkdy SELECT DtDay FROM AllDays where ( (mnth =1 and dayofM = 1) -- new years or (mnth =5 and dayofM >= 25 and dtname = 'Monday') -- memorial day or (mnth =7 and dayofM = 4) -- Indendence day or (mnth =9 and dayofM <= 7 and dtname = 'Monday') -- Labour day or (mnth =11 and dayofM between 22 and 28 and dtname = 'Thursday') -- Thanksgiving or (mnth =12 and dayofM = 25) -- Xmas ) OPTION (MAXRECURSION 0)[/code]Any help would be appreciated. AGAIN : This runs perfectly fine in JasperSoft Studio Preview AND SQL Server Management Studio.
  6. Hi, I have a group that contains 3 separate sub reports - each with a vastly different query. This is basically a detailed listing of information - if specific conditions apply. When there is no information to display, I still get a blank page in my report. How can I remove the group when all 3 subreports are empty? Code below: <group name="Group2"> <groupExpression><![CDATA[$F{PROJECTID}]]></groupExpression> <groupHeader> <band height="132"> <subreport> <reportElement positionType="Float" x="-20" y="0" width="476" height="44" isRemoveLineWhenBlank="true" uuid="f23d4dd8-78da-4966-b78b-15dea93bcc17"/> <subreportParameter name="p_prj"> <subreportParameterExpression><![CDATA[$F{PROJECTKEY}]]></subreportParameterExpression> </subreportParameter> <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression> <subreportExpression><![CDATA["repo:r&i.jrxml"]]></subreportExpression> </subreport> <subreport> <reportElement positionType="Float" x="-20" y="88" width="476" height="44" isRemoveLineWhenBlank="true" uuid="71e03d07-b3dc-4091-ba76-4f33fa5ee396"/> <subreportParameter name="p_prj"> <subreportParameterExpression><![CDATA[$F{PROJECTKEY}]]></subreportParameterExpression> </subreportParameter> <connectionExpression><![CDATA[java.sql.DriverManager.getConnection("jdbc:sqlserver://#####;databaseName=####","####","####")]]></connectionExpression> <subreportExpression><![CDATA["repo:Defects.jrxml"]]></subreportExpression> </subreport> <subreport> <reportElement positionType="Float" x="-20" y="44" width="476" height="44" isRemoveLineWhenBlank="true" uuid="95eccdc4-efae-418d-a581-471d5ab54f30"/> <subreportParameter name="p_prj"> <subreportParameterExpression><![CDATA[$F{PROJECTKEY}]]></subreportParameterExpression> </subreportParameter> <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression> <subreportExpression><![CDATA["repo:Issues.jrxml"]]></subreportExpression> </subreport> </band> </groupHeader> </group> Thank you, Chris
  7. Is this value a field in the main report? If so - Try this: Create a parameter in the main report named p_clientID. Make sure that it is set to "Is For Prompting" is selected. Then click on the sub report object, and then the subreport tab, click parameters and add a new parameter with the same name. Then click expression (a box with [...] will show) and use the field from the main report. In your subreport, modify your query to something like "WHERE client_id = $P{p_clientID}" This should pass the parameter from the main report to the sub report. If it is not a field in the report - Create same parameters, but the expression would be $P{p_clientID} or $P!{p_clientID}
  8. Hello, I have two fields, $F{UPCOMINGEVENTS} and $F{ACCOMPLISHMENTS}. Each of these fields have a label, which is in the same group. The fields are set to Blank When Null, which works fine. I am trying to find a way to also remove the labels when the field is blank. I found a response that was like this $F{UPCOMINGEVENTS}==null?"":$F{LabelName} this did not work as it could not resolve the label as a field. Any thoughts? <textField> <reportElement positionType="Float" x="440" y="82" width="120" height="18" uuid="f2f0234a-624f-4651-a768-f7532717483d"/> <textElement> <font isBold="true"/> </textElement> <textFieldExpression><![CDATA["Upcoming Activities:"]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="true"> <reportElement positionType="Float" x="440" y="100" width="340" height="40" uuid="7f192789-debc-4da5-9836-da64a626b9d2"> <property name="local_mesure_unity" value="inch"/> </reportElement> <box padding="0"> <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> </box> <textFieldExpression><![CDATA[$F{UPCOMINGEVENTS}]]></textFieldExpression> </textField>[/code]
  9. Thank you "Friendly User" - This was the issue. It is now working the way that I need it to.
  10. Caused by: java.lang.ClassCastException: com.microsoft.sqlserver.jdbc.SQLServerConnection cannot be cast to net.sf.jasperreports.engine.JRDataSource I am trying to create a connection to a data source for my subreport - here is parameter expression : (Blocked out company information for this) <parameter name="subreport_datasource" class="java.sql.Connection" isForPrompting="false"> <defaultValueExpression><![CDATA[java.sql.DriverManager.getConnection("jdbc:sqlserver://Host;databaseName","user","pword")]]></defaultValueExpression> </parameter>[/code]
  11. Thank you for your comment, that just produced a different error - which leads me to believe that the first error was not the issue in the first place... : com.microsoft.sqlserver.jdbc.SQLServerConnection cannot be cast to net.sf.jasperreports.engine.JRDataSource
  12. Hello. This issue stems from my report concept. I am trying to create a main report that houses minimal information. I then have a sub report that pulls in some related information from other db tables. I am trying to add another subreport that uses a separate datasource from the other two reports. I have searched online and found a solution that I thought would work, and I still think that it would work, if not running into this issue : java.sql.DriverManager.getConnection("jdbc:sqlserver://HostName;dbName","username","password")[/code]Now - Before anyone answers saying that I should not have the //HostName portion - I know this... This is my problem... When the DBA's in my organization named this, they added that backslash ( ) into the hostname. I cannot get around this if I want to connect. I was able to create a Data Adapter using this, but cannot create an expression using the same. Kicks out the following : Invalid escape sequence (valid ones are b t n f r " ' \) Is there a workaround, or another method that will be equally successful? The report runs, and the first subreport shows its data, but second subreport shows nothing, no matter what I do (because it is not getting data from the correct data source) Any Ideas?
  13. Yes to both: Sub report band is called, and variable is actually in the band to show the value pulled. Main report pulls a separate query, sends a parameter to be used as a criteria in the sub report. Sub report sends variable back and prints the main report band based on whether or not the variable is null.
  14. So - I was finally able to get the report to compile and run, however... The variable on the main report is returning null every time, therefore my band will not print.. Code from main report : <variable name="v_return" class="java.lang.String" resetType="None" calculation="System"/> <printWhenExpression><![CDATA[new Boolean($V{v_return}!= null)]]></printWhenExpression> <returnValue subreportVariable="v_return" toVariable="v_return" calculation="System"/> Sub Report : <variable name="v_return" class="java.lang.String" resetType="None" calculation="System"> <variableExpression><![CDATA[$F{Type}]]></variableExpression> </variable>
×
×
  • Create New...