runner1549 Posted September 18, 2009 Share Posted September 18, 2009 Do you have an easier way to edit SQL code in iReport and get the benefits of TOAD's attached column prompting without having to do the below steps ?1. create report2. six months later get a request to change the report3. open JRXML in iReport4. open "Report Query" Window5. copy below SQL into TOAD================================================select fmr.FMCODE COMPONENT, fmrc.FMPERCENTAGE * 100 PERC, nlln.NLTEXT, fmr.FMCAS, fmppc.FMMINIMUM ALLERGEN, fmP.fmcode PARENT from fmresource fmr inner join gml_cas gcas on fmr.FMCAS = gcas.CAS inner join nllabelname nlln on nlln.FMENTITYOBJECTID = fmr.FMENTITYOBJECTID inner join fmpropertyassign fmpa on fmpa.FMENTITYOBJECTID = fmr.FMENTITYOBJECTID inner join fmpropasschar fmppc on fmppc.FMPROPERTYASSIGNID = fmpa.FMPROPERTYASSIGNID inner join FMRESOURCECMP fmrc on fmrc.FMRESCOMPONENTID=fmr.FMENTITYOBJECTIDinner join fmresource fmP on fmrc.fmresourceid = fmP.fmentityobjectidwhere fmpa.FMPROPERTYID = 391 and fmP.fmcode LIKE $P{FMCODE}--where fmpa.FMPROPERTYID = 391 and fmP.fmcode LIKE '%A1539%'and fmr.FMCAS = $P{FMCAS}--and fmr.FMCAS = 150================================================ 6. comment out $P... lines, uncomment value lines 7. tweak SQL in TOAD 8. run to make sure SQL works 9. uncomment $P... lines, comment out value lines10. copy new SQL back into iReport Link to comment Share on other sites More sharing options...
svenn Posted September 18, 2009 Share Posted September 18, 2009 No but it would be great if someone knew a way to do this. Link to comment Share on other sites More sharing options...
mdahlman Posted September 22, 2009 Share Posted September 22, 2009 Excellent question! I do approximately the same thing as you. But it's slightly easier using SQuirreL instead of Toad. My steps are like this: 1. create report2. six months later get a request to change the report3. open JRXML in iReport4. open "Report Query" Window[There is no possible way to avoid steps 1 to 4.][it would be nice if we could improve steps 5 - 10.]5. copy SQL into SQuirreL6. The SQuirreL plugin SQLReplace lets you define substitution values for the $P{param} values. So most of my reports work immediately. Occasionally I need to an another replacement value.7. tweak SQL in TOAD8. run to make sure SQL works9. [no need to un-tweak the SQL]10. copy new SQL back into iReport It's a bit shorter, but more importantly it removes the most likely source of errors. You don't need to remove and re-add the $P values. Regards,Matt Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now