[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2861
  • Last Modified:

Sub Reports in CRM 4.0

I am trying to replace the invoice report for a custom one in MS Dynamics CRM 4.0

The report is made of a main report and a sub report. In understand that you have to register the sub report with SRS rather than upload it into CRM, however, this doesn't seam to work, i just get 'Error: Subreport could not be shown.'

Could someone please shed some light on the proper procedure and troubleshooting steps?

Thanks

Dave
0
Dave_Angel_Portsmouth
Asked:
Dave_Angel_Portsmouth
  • 6
  • 6
  • 3
  • +1
2 Solutions
 
Auric1983Commented:
Dave,

I've never setup custom SSRS reports for CRM, but in my experience working w/ Sub reports they need to be "reachable" by the main report.

Typically in SSRS I upload the main/sub into a directory together.  Not sure what the equivalent would be in CRM though (sorry)

It sounds as if the main report just can't find the sub as the source doesn't get embedded in the main report, just a pointer to the sub report file..
0
 
rakeshAgarwalCommented:
1. Please upload both the report in crm   ( no need to go to srs)
2. Try  to run that report
3. If this gives you an error then  
4. Go to srs and try to run the report ( this give you an exact error message)

regards
rakesh agarwal
www.dynamicsexchange.com 
we can deliver CRM Reports in 24 hrs :)
0
 
stacko111Commented:
In my experience the most common reason for the sub-report not running is beacuse it need parameters from the main report, these would need to be defined in SSRS. As Rakes says, if you log in to SQL Reporting Services and preview the main report, it should tell you why the sub-report isn't running.
0
Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 
Dave_Angel_PortsmouthAuthor Commented:
Thanks for the advise, spent yesturday trying to get it working.

Thanks for the advice on using SSRS to get the error code, that helped alot - some feilds were not being picked up correctly from the dataset. I am now able to see the sub report, but it is not filtering correctly. Thats to say if i select an invoice from CRM, the main report will show the invoice ID and addresses etc, but the sub report will list all items for all invoices, not just the one selected.

What do i need to do next?

Thanks,

Dave
0
 
stacko111Commented:
Get your sub report working as if it was a main report. I.e. It sounds like you use the invoice number as a parameter on the main report so also use this on the sub-report.

Once this is working, set the parameter to 'hidden' on the sub report.

Next in the main report that holds your sub-report, right-click the sub-report and go into Properties > Parameters. Now set the parameter to your Invoice number.

When the main report runs with the invoice number, it will be passed to the sub-report so both should display properly. Let me know how you get on.
0
 
Dave_Angel_PortsmouthAuthor Commented:
Stacko,

Thanks for that. I can add a parameter on the main report to the sub report properties, but when i try and add reference to the sub report, VS does not let me save it, what am i doing wrong?
screenshot
0
 
stacko111Commented:
Does the sub-report have the same parameter? You should set up the sub report with the parameter before putting it iinto the main report.

Also once you have the parameter on the subreport working - make sure you set it to hidden.
0
 
Dave_Angel_PortsmouthAuthor Commented:
Stacko,

No matter what combination I try, i keep getting

"The properties for the currently selected item are not valid. Please correct all errors before continuing"
0
 
stacko111Commented:
Not sure what is happening I'm afraid, if you upload the project file I'll have a look at it.
0
 
Dave_Angel_PortsmouthAuthor Commented:
Thank you for the offer please find code attached have renamed as txt files

at the moment these come up with the error " Sub report cannot be displayed"


Invoice-Main.TXT
InvoiceBody.TXT
0
 
stacko111Commented:
Ok two initial things show up:

1. The connection string for both reports contain Adventure_Works_Cycle_MSCRM - this is the test database that ships with CRM, is this deliberate?

2. In the INV_invoiceid parameter you've put '=select invoiceid from DMMain' into the Default Value section, try setting this to 'Null'
0
 
Dave_Angel_PortsmouthAuthor Commented:
1) yes, i'm still using the test database at the moment so thats to be expected

2) Tried that, but all i still get "Sub report cannot be displayed"

Should i be adding the report parameters to both Main and Sub form? at the moment its only on the sub form.

On the main form the properties of the sub report are:

Parameter Name = INV_invoiceid
Parameter Value =  =Fields!invoiceid.Value

Thanks
0
 
stacko111Commented:
Sorry I presumed you were using the parameter in both reports. I think the only problem now is that the 'invoiceid' field isn't in any of the datasets in your main report. Try adding it there (probably to the DSMain one).
0
 
rakeshAgarwalCommented:
instead  of INV_invoiceid

CRM_invoiceid


0
 
rakeshAgarwalCommented:
I think you have generated report using  report wizard.  You will not be able to get the desired result.

 Somebody has to rewrite the report.
Regards
Rakesh Agarwal
0
 
Dave_Angel_PortsmouthAuthor Commented:
Many thanks for all your help
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

  • 6
  • 6
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now