question

Paul-4416 avatar image
0 Votes"
Paul-4416 asked RichardUchytil-9306 commented

CreateCatalogItem method

In ReportingService2010 web service, I created the C# Console App to upload files such as Excel, HTML, files to a folder in SSRS2019. Using the "CreateCatalogItem" method, I managed to upload the RDL files using "Report" in the "ItemType" with "null" on the "Property", however, when using the "Resource" in the "ItemType" for other types of files, it failed on the "Property". I am not sure on how to specify the "Property" such as "MimeType" for other type of files such as Excel and HTML files. Thanks.

FileStream stream = ReportFile.OpenRead();
definition = new Byte[stream.Length];
stream.Read(definition, 0, (int)stream.Length);
stream.Close();
CreateCatalogitem("Resource", ReportFile.Name, @"/SSRS_Upload", true, definition, null, out Warnings) ;

sql-server-reporting-servicesdotnet-cli
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

AniyaTangMSFT-7891 avatar image
0 Votes"
AniyaTangMSFT-7891 answered RichardUchytil-9306 commented
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi
Thank you for posting the suggested answer. I tried the new "Property" to the code just before calling the "CreateCatalogItem" and it failed with the error "The value for property 'MimeType' is not specified. The property is either missing or its value is null." What is the "value" for the property for the HTML and Excel file type? Thanks

0 Votes 0 ·

Hi @Paul-4416
I am not very familiar with C# code, maybe you can ask here:https://docs.microsoft.com/en-us/answers/topics/164785/dotnet-csharp.html.
Regards,
Aniya

0 Votes 0 ·

Thank you for the reply. I did check out the mentioned links before. As for the HTML and Excel file types, I added the"Property" such as the "ItemType" to "Resource" and "Property.Name" = "MimeType" and the "Property.Value" = "application/html" or "application/xlsx" just before the "CreateCatalogItem" method. It worked. Thanks.

0 Votes 0 ·

Hi @Paul-4416!

I'm trying to upload Excel files to our server (this is our version: Microsoft SQL Server Reporting Services Version 15.0.1102.932) using Powershell. It works fine except Excel files get uploaded into the "RESOURCES" group instead of the "EXCEL WORKBOOKS" group. I can change the data in the Catalog table to fix this, but I'd like to fix it on the upload. For my MimeType I'm using application/vnd.openxmlformats-officedocument.spreadsheetml.sheet. I tried application/html & application/xlsx, both worked the same as what I'm currently doing. When you upload do your Excel documents go into the "EXCEL WORKBOOKS" group?

Curiously, I tried my same Powershell on an older server (Microsoft SQL Server Reporting Services Version 13.0.6404.1) and they DID get put into the "EXCEL WORKBOOKS" group. It appears Microsoft changed something with the newer version.

Thanks very much!

0 Votes 0 ·