We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Exception 'Cell shading sprm is too long.' occured in Aspose.Words for .NET 5.1.0.0

Hi ,
I have a report with a matrix layout and multiple rowgroups and a static columngroup that does not export to word.
Following is the error:

Exception 'Cell shading sprm is too long.' occured in Aspose.Words for .NET 5.1.0.0.
For free technical support, please post this error and the file in the Aspose.Words Forums http://www.aspose.com/forums/ShowForum.aspx?ForumID=75.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:

System.Exception: Exception 'Cell shading sprm is too long.' occured in Aspose.Words for .NET 5.1.0.0.
For free technical support, please post this error and the file in the Aspose.Words Forums http://www.aspose.com/forums/ShowForum.aspx?ForumID=75.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[Exception: Exception ‘Cell shading sprm is too long.’ occured in Aspose.Words for .NET 5.1.0.0.
For free technical support, please post this error and the file in the Aspose.Words Forums http://www.aspose.com/forums/ShowForum.aspx?ForumID=75.]
[Exception: An error occurred during rendering of the report.]

[Exception: An unexpected error occurred in Report Processing.]

Microsoft.Reporting.WebForms.ServerReport.ServerUrlRequest(Boolean isAbortable, String url, Stream outputStream, String& mimeType, String& fileNameExtension) +495

Microsoft.Reporting.WebForms.ServerReport.InternalRender(Boolean isAbortable, String format, String deviceInfo, NameValueCollection urlAccessParameters, Stream reportStream, String& mimeType, String& fileNameExtension) +958

Microsoft.Reporting.WebForms.ServerReportControlSource.RenderReport(String format, String deviceInfo, NameValueCollection additionalParams, String& mimeType, String& fileExtension) +84

Microsoft.Reporting.WebForms.ExportOperation.PerformOperation(NameValueCollection urlQuery, HttpResponse response) +143

Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext context) +110

System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +303

System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64

Thanks,
Panna

Hi
Thanks for your request. Could you please attach your RDL report for testing?
Best regards.

Here is the rdl .
thanks a lot!

Thanks. I will work on your issue shortly.

Hi Dmitry,
Did you get a chance to look at this?
Thanks for your help!

Yes (sorry for not responding earlier), and I can export this report without any problems (find attached). Is it possible to provide me with your data source? I’m using a dummy data source for testing purposes and therefore the replication of the issue is not exact.
And frankly, this exception is strange for AWRS because it normally occurs when reading an incorrect DOC file, not building a new one. Don’t you use Aspose.Words separately to process Word documents?

I am having the same issue in the Aspose.Words for Java.

This error only happens AFTER I apply a license. If I run it in evaluation it produces the document just fine (except for the evalution text in RED at the top).
The document produced can be opened (as file argument to Document) and output just fine with or without the license being applied.

Attached is the output document, working on isolating the input conditions.

The document construction runs fine but when I go to write it or save it I get the following:

[com.caci.arms.utility.aspose.AsposeUnitRecordMSWordDoc] - Cell shading sprm is too long.
java.lang.IllegalStateException: Cell shading sprm is too long.
at com.aspose.words.po.a(TablePrFiler.java:604)
at com.aspose.words.po.cg(TablePrFiler.java:483)
at com.aspose.words.js.a(PrFiler.java:36)
at com.aspose.words.po.a(TablePrFiler.java:40)
at com.aspose.words.dp.b(DocWriter.java:405)
at com.aspose.words.dp.visitRowEnd(DocWriter.java:375)
at com.aspose.words.Row.accept(Row.java:148)
at com.aspose.words.CompositeNode.acceptChildren(CompositeNode.java:782)
at com.aspose.words.Table.accept(Table.java:93)
at com.aspose.words.CompositeNode.acceptChildren(CompositeNode.java:782)
at com.aspose.words.Body.accept(Body.java:69)
at com.aspose.words.dp.b(DocWriter.java:220)
at com.aspose.words.dp.run(DocWriter.java:167)
at com.aspose.words.dp.a(DocWriter.java:26)
at com.aspose.words.Document.a(Document.java:1494)
at com.aspose.words.Document.save(Document.java:907)

unable to find a clear workaround or documentation on fixes for this issue.

Hello

Thanks for your interest in Aspose.Words for Java. I cannot reproduce the problem on my side using the latest version of Aspose.Words for Java (4.0.2). You can download this version from here:
https://releases.aspose.com/words/java
Please try using the latest version of Aspose.Words for Java, and let me know how it goes on your side.
Best regards,

I have isolated the data set that is causing the issue.

See attached file, run as java application, will reproduce the error.

java.lang.IllegalStateException: Cell shading sprm is too long.
at com.aspose.words.po.a(TablePrFiler.java:604)
at com.aspose.words.po.cg(TablePrFiler.java:483)
at com.aspose.words.js.a(PrFiler.java:36)
at com.aspose.words.po.a(TablePrFiler.java:40)
at com.aspose.words.dp.b(DocWriter.java:405)
at com.aspose.words.dp.visitRowEnd(DocWriter.java:375)
at com.aspose.words.Row.accept(Row.java:148)
at com.aspose.words.CompositeNode.acceptChildren(CompositeNode.java:782)
at com.aspose.words.Table.accept(Table.java:93)
at com.aspose.words.CompositeNode.acceptChildren(CompositeNode.java:782)
at com.aspose.words.Body.accept(Body.java:69)
at com.aspose.words.dp.b(DocWriter.java:220)
at com.aspose.words.dp.run(DocWriter.java:167)
at com.aspose.words.dp.a(DocWriter.java:26)
at com.aspose.words.Document.a(Document.java:1494)
at com.aspose.words.Document.save(Document.java:907)
at com.caci.arms.utility.aspose.AsposeTest.createCommentsDoc2(AsposeTest.java:298)
at com.caci.arms.utility.aspose.AsposeTest.main(AsposeTest.java:11)

Hi

Thank you for additional information. The problem occurs because you missed round brackets in one of conditions and that is why condition was calculated improperly. Here is snippet of code, which caused the problem (I highlighted my changes):

for (int i = 0; i < dataElements.length; i++)
{
    String data = dataElements[i];
    db.write(data);
    System.out.println("data-->" + data);
    if (i == (dataElements.length - 1))
    {
        break;
    }
    else
    {
        if (((i + 1) % tableCols) == 0)
        {
            db.endRow();
            db.insertCell();
        }
        else
        {
            db.insertCell();
        }
    }
}

Best regards.