Crystal reports no data lable - crystal-reports

I have a report containing some sub reports and in my main report i am showing the sub reports based on scan mode and status coming from query.
Now i need to show a message whenever sub reports don't have data.
I tried like this.
checked supress blank sub report and supress blank section for all reports.
1.Kept a text box in report footer of main report.
2.Took a field (Say Barcode) from sub report and passed to main report using shared variable.
3.In section expert of text box wrote like this.
not isnull(Barcode)
But it is not working.
Please suggest.

If I have understood this correctly the code below should work. Tip, avoid using NOT ISNULL. If possible just change the outcome order of your IF statement as below.
To make your formula more robust also, it's a great idea to add in the:
OR = ""
To account for any blank entries.
Final code:
IF Isnull({Barcode}) OR {Barcode} = "" THEN FALSE ELSE TRUE

Related

Crystal Report - Printing information from sub-report

I am working on a Crystal Report and if the address which is in a subreport is duplicate I need the information to print on the same page if it’s different I need it to print on a separate page....Please Help!
Like AmmoPT said, we might need more information to help you.
But maybe you you can try this:
Right click on the section where the sub-report is: Section Expert - Paging .
Then on new page before, click the x-2 formula icon and use something like this:
if {your_adress_field}=previous({your_adress_field}) then false else true

CR2008 Suppressed SubReport's parameters are showing on main report

I am a very new user to crystal and have taken over a project that someone else has done and left.
Here is my current issue. I have a Main report that has a ton of sub reports on it. There is one sub-report that is suppressed that is causing a parameter prompt on the main report. I have looked through documentation about the links from main to sub but there is no link between these sub-report parameters and the main report. Also the sub report uses these parameters in the report itself. IE start date - end date are the parameters and are used on the sub report so I can't just remove them. How can I stop the prompt for these two parameters from the sub-report in the main report?
Thanks a Ton.
In the end I created a new report and just did not include the sub report mentioned. Thanks.

Why crystal reports sub report does not display some fields on viewer

I have crystal report with main report and sub report. Main report contains group sections.
I have linked sub report with main report using id. When I preview it on preview tab, both main and sub reports are working and displaying correct data.
But, when I preview it on the viewer with my application, main report data shows correct, but some sub report fields are not visible. I have noticed that, when I put the ID field to view in sub report, it shows a number of records. but only ID field is shown, and other fields are not visible.
I have set two record sets to main report and sub report. it seems records are returning data, but sub report does not shows them. Can anyone please point me in right direction to solve this?
Not sure how you are loading your report in the Crystal viewer, but keep in mind that if your report uses subreports, in your code when you are loading the report, you need to also set the data source for each subreport. See the following incomplete code snippet:
//SET DATASOURCE FOR EACH SUBREPORT IN REPORT
foreach (CrystalDecisions.CrystalReports.Engine.Section section in CrystalReportSource2.ReportDocument.ReportDefinition.Sections)
{
// In each section we need to loop through all the reporting objects
foreach (CrystalDecisions.CrystalReports.Engine.ReportObject reportObject in section.ReportObjects)
{
if (reportObject.Kind == ReportObjectKind.SubreportObject)
{
SubreportObject subReport = (SubreportObject)reportObject;
ReportDocument subDocument = subReport.OpenSubreport(subReport.SubreportName);
foreach (CrystalDecisions.CrystalReports.Engine.Table table in subDocument.Database.Tables)
{
// Cache the logon info block
TableLogOnInfo logOnInfo = table.LogOnInfo;
// Set the connection
logOnInfo.ConnectionInfo = crConnectionInfo;
// Apply the connection to the table!
table.ApplyLogOnInfo(logOnInfo);
}
}
}
}

Display centered page header in a sub report which is placed in a multi column formatted section

More than a full day gone and i still can't find a solution...
I am creating a report which will be used to print out an exam paper(Crystal Reports with VS 2010). All exams have more than one related unit and all units have their own questions.
So i have created a sub report with the units and questions and added to the main reports' Details section which formatted as multicolumn. I have generated the report which seems like below.
http://www.avekon.com/tmp/examprintscreen0.png
Everything is fine until now. But when i want to add the unit titles (which are in the subreport),they are displayed as headers of each column. I want to display the unit title as centered on the top of each page, like below.
http://www.avekon.com/tmp/examprintscreen.png
Tried to add a header to main report and update it from subreport. NOT WORKED! Because the variables are not while the subreport is looping.
Tried to format other sections as multi column. NOT POSSIBLE as i see.
Tried to insert sub report into sub report. NOT POSSIBLE again.
and i have tried a lot of other logical and illogical ways but no success at the end. It should be easy but i can not find the right way. Please help, really important!
Remove the multi-column formatting from the main report and instead, format the sub-report as multi-column.
This should do the trick.

iReport, subreport does not appear

i'm trying to add subreport to report.
I have setted connection type to "use a connection expression" and the expression is $P{REPORT_CONNECTION}.
My subreport contains a simple query and some static text, when i test it all works good, but when i test mainreport the subreport does not appear.
I have some static text in subreport, this one should be display always, isn't true? But i can't see it...
During compilation i have no errors, and subreport path seems correct becouse a message say "subreport.jrxml already compiled.".
What can i do?
Thanks.
The solution is pass HIBERNATE_SESSION as parameter from master report to subreport.
Please Right clik on sub report and clik on open sub report if your sub report gets open then your reporyt is connect with your sub report. if subreport is not open do the right connection for that.
if your subreport is work for the parameter value with seperatly and displyes the static text and detail band values it is sure that the report will come ffrom main report.
but the report displays only static text and the text is in title or page heder, then you have to go to the report property and set the output when no data then choose diplay all section data from combo. your static text will apper from main report.
When you add a sub-report in your main report, the sub report expression will refer your locally saved sub-report path. Ex: "C:\abc\xyz.jrxml".
Now you can preview your main report containing sub-report in your ireport.
Once you publish the main report in Jasper server, the Sub report gets loaded into jasper repository and its expression becomes "repo:Repositorypath.jrxml".
Once sub-report contained report is published into Jasper repository, its path will always refers to Jasper repository path and because of this reason, you will not be able to Preview the main report in Ireport.
So, execute the report in jasper server directly once you publish the main report instead of previewing or opening the subreport in Ireport.
Thanks,
Srikanth Kattam