Render Document using APIs in ASP.NET Application
Moderator: Lisa Ennis
-
- Posts: 4
- Joined: Thu Mar 09, 2017 3:09 am
Render Document using APIs in ASP.NET Application
We are rendering commitment and Invoice docs using APIs,but we are getting following exception.This is working fine in Console Application,but troubling in ASP.NET application.Did i miss any DLLs? , hard to understand what i missed,almost all the required DLLs added.
Here is the Exception Message ,Stack Trace and Inner Exception.
The type initializer for 'SoftPro.Select.Client.Fieldcodes.FieldResolver' threw an exception.
Could not load file or assembly 'file:///C:\Workspace\FD-P2\Fnf.NetSolutions.Website\SoftPro.OrderTracking.Client.dll' or one of its dependencies. The system cannot find the file specified.
at SoftPro.Select.Client.Fieldcodes.FieldResolver..ctor(IServiceProvider sp)
at SoftPro.Select.Client.Fieldcodes.FieldcodeResolver..ctor(IServiceProvider sp)
at SoftPro.Select.Client.Fieldcodes.FieldcodeProcessing.SoftPro.Select.Client.Fieldcodes.IFieldcodeProcessing.GetResolver()
at SoftPro.Documents.Markup.Analyzer.Initialize(IServiceProvider sp)
at SoftPro.Documents.Markup.Analyzer..ctor(IServiceProvider sp, IRenderingAdapter adapter)
at SoftPro.Documents.Rendering.TextControl.TXTextRendererImpl.SoftPro.Documents.Client.Rendering.IRendererImpl.Render(IRenderable renderable, Object context, IPrompt`1 prompt, IProgress`1 progress, CancellationToken cancellationToken)
at SoftPro.Documents.Client.Rendering.Renderer.InternalRender(IRenderable renderable, Object context, IPrompt`1 prompt, IProgress`1 progress, CancellationToken cancellationToken)
at SoftPro.Documents.Client.Rendering.Renderer.InternalRender(IDocumentInfo document, Object context, IPrompt`1 prompt, IProgress`1 progress, CancellationToken cancellationToken)
at SoftPro.Documents.Client.Rendering.Renderer.Render(IDocumentInfo document, Object context, IPrompt`1 prompt)
at Module.SoftProClient.Business.LiveScheduleA.RenderDoc(IOrder iorder, IDocumentManager docMgr, IRenderer renderer, String docName) in C:\Workspace\FD-P2\Module.SoftPro\Business\LiveScheduleA.cs:line 264
at Module.SoftProClient.Business.LiveScheduleA.GetDocuments(String OrderNumber, List`1 documentsList) in C:\Workspace\FD-P2\Module.SoftPro\Business\LiveScheduleA.cs:line 241
Thanks in advance
Here is the Exception Message ,Stack Trace and Inner Exception.
The type initializer for 'SoftPro.Select.Client.Fieldcodes.FieldResolver' threw an exception.
Could not load file or assembly 'file:///C:\Workspace\FD-P2\Fnf.NetSolutions.Website\SoftPro.OrderTracking.Client.dll' or one of its dependencies. The system cannot find the file specified.
at SoftPro.Select.Client.Fieldcodes.FieldResolver..ctor(IServiceProvider sp)
at SoftPro.Select.Client.Fieldcodes.FieldcodeResolver..ctor(IServiceProvider sp)
at SoftPro.Select.Client.Fieldcodes.FieldcodeProcessing.SoftPro.Select.Client.Fieldcodes.IFieldcodeProcessing.GetResolver()
at SoftPro.Documents.Markup.Analyzer.Initialize(IServiceProvider sp)
at SoftPro.Documents.Markup.Analyzer..ctor(IServiceProvider sp, IRenderingAdapter adapter)
at SoftPro.Documents.Rendering.TextControl.TXTextRendererImpl.SoftPro.Documents.Client.Rendering.IRendererImpl.Render(IRenderable renderable, Object context, IPrompt`1 prompt, IProgress`1 progress, CancellationToken cancellationToken)
at SoftPro.Documents.Client.Rendering.Renderer.InternalRender(IRenderable renderable, Object context, IPrompt`1 prompt, IProgress`1 progress, CancellationToken cancellationToken)
at SoftPro.Documents.Client.Rendering.Renderer.InternalRender(IDocumentInfo document, Object context, IPrompt`1 prompt, IProgress`1 progress, CancellationToken cancellationToken)
at SoftPro.Documents.Client.Rendering.Renderer.Render(IDocumentInfo document, Object context, IPrompt`1 prompt)
at Module.SoftProClient.Business.LiveScheduleA.RenderDoc(IOrder iorder, IDocumentManager docMgr, IRenderer renderer, String docName) in C:\Workspace\FD-P2\Module.SoftPro\Business\LiveScheduleA.cs:line 264
at Module.SoftProClient.Business.LiveScheduleA.GetDocuments(String OrderNumber, List`1 documentsList) in C:\Workspace\FD-P2\Module.SoftPro\Business\LiveScheduleA.cs:line 241
Thanks in advance
-
- Posts: 1377
- Joined: Wed Jan 15, 2014 3:50 pm
- Location: Raleigh, NC
- Contact:
Re: Render Document using APIs in ASP.NET Application
It appears you missed one or more required DLLs. See viewtopic.php?f=17&t=1093 for a discussion on how to determine what file(s) is missing by examining the exception information.
By the way, your problem is with the API and not the Crystal Report. In the future, you should look at the Integration Development / General forum. You will find helpful solutions to many API related issues.
By the way, your problem is with the API and not the Crystal Report. In the future, you should look at the Integration Development / General forum. You will find helpful solutions to many API related issues.
Bob Richards, Senior Software Developer, SoftPro
-
- Posts: 4
- Joined: Thu Mar 09, 2017 3:09 am
Re: Render Document using APIs in ASP.NET Application
We Copied all DLLs into Bin Directory,after that getting following exception.If you have any samples for rendering docs in ASP.NET app would be much helpful.
Message: Type SoftPro.Select.Client.Fieldcodes.SelectFieldResolutionHandler does not implement IFieldResolutionHandler.
Stack Trace:
at SoftPro.Select.Client.Fieldcodes.FieldResolver.Create(Type type)
at SoftPro.Select.Client.Fieldcodes.FieldResolver.<CreateHandlers>b__12_0(Type type)
at System.Collections.Generic.List`1.ForEach(Action`1 action)
at SoftPro.Select.Client.Fieldcodes.FieldResolver.CreateHandlers()
at SoftPro.Select.Client.Fieldcodes.FieldResolver..ctor(IServiceProvider sp)
at SoftPro.Select.Client.Fieldcodes.FieldcodeResolver..ctor(IServiceProvider sp)
at SoftPro.Select.Client.Fieldcodes.FieldcodeProcessing.SoftPro.Select.Client.Fieldcodes.IFieldcodeProcessing.GetResolver()
at SoftPro.Documents.Markup.Analyzer.Initialize(IServiceProvider sp)
at SoftPro.Documents.Markup.Analyzer..ctor(IServiceProvider sp, IRenderingAdapter adapter)
at SoftPro.Documents.Rendering.TextControl.TXTextRendererImpl.SoftPro.Documents.Client.Rendering.IRendererImpl.Render(IRenderable renderable, Object context, IPrompt`1 prompt, IProgress`1 progress, CancellationToken cancellationToken)
at SoftPro.Documents.Client.Rendering.Renderer.InternalRender(IRenderable renderable, Object context, IPrompt`1 prompt, IProgress`1 progress, CancellationToken cancellationToken)
at SoftPro.Documents.Client.Rendering.Renderer.InternalRender(IDocumentInfo document, Object context, IPrompt`1 prompt, IProgress`1 progress, CancellationToken cancellationToken)
at SoftPro.Documents.Client.Rendering.Renderer.Render(IDocumentInfo document, Object context, IPrompt`1 prompt)
at Module.SoftProClient.Business.LiveScheduleA.RenderDoc(IOrder iorder, IDocumentManager docMgr, IRenderer renderer, String docName) in d:\FNF Global\illinois_ticortitle_com_redesign_FNFI-P2\Module.SoftPro\Business\LiveScheduleA.cs:line 264
at Module.SoftProClient.Business.LiveScheduleA.GetDocuments(String OrderNumber, List`1 documentsList) in d:\FNF Global\illinois_ticortitle_com_redesign_FNFI-P2\Module.SoftPro\Business\LiveScheduleA.cs:line 241
Message: Type SoftPro.Select.Client.Fieldcodes.SelectFieldResolutionHandler does not implement IFieldResolutionHandler.
Stack Trace:
at SoftPro.Select.Client.Fieldcodes.FieldResolver.Create(Type type)
at SoftPro.Select.Client.Fieldcodes.FieldResolver.<CreateHandlers>b__12_0(Type type)
at System.Collections.Generic.List`1.ForEach(Action`1 action)
at SoftPro.Select.Client.Fieldcodes.FieldResolver.CreateHandlers()
at SoftPro.Select.Client.Fieldcodes.FieldResolver..ctor(IServiceProvider sp)
at SoftPro.Select.Client.Fieldcodes.FieldcodeResolver..ctor(IServiceProvider sp)
at SoftPro.Select.Client.Fieldcodes.FieldcodeProcessing.SoftPro.Select.Client.Fieldcodes.IFieldcodeProcessing.GetResolver()
at SoftPro.Documents.Markup.Analyzer.Initialize(IServiceProvider sp)
at SoftPro.Documents.Markup.Analyzer..ctor(IServiceProvider sp, IRenderingAdapter adapter)
at SoftPro.Documents.Rendering.TextControl.TXTextRendererImpl.SoftPro.Documents.Client.Rendering.IRendererImpl.Render(IRenderable renderable, Object context, IPrompt`1 prompt, IProgress`1 progress, CancellationToken cancellationToken)
at SoftPro.Documents.Client.Rendering.Renderer.InternalRender(IRenderable renderable, Object context, IPrompt`1 prompt, IProgress`1 progress, CancellationToken cancellationToken)
at SoftPro.Documents.Client.Rendering.Renderer.InternalRender(IDocumentInfo document, Object context, IPrompt`1 prompt, IProgress`1 progress, CancellationToken cancellationToken)
at SoftPro.Documents.Client.Rendering.Renderer.Render(IDocumentInfo document, Object context, IPrompt`1 prompt)
at Module.SoftProClient.Business.LiveScheduleA.RenderDoc(IOrder iorder, IDocumentManager docMgr, IRenderer renderer, String docName) in d:\FNF Global\illinois_ticortitle_com_redesign_FNFI-P2\Module.SoftPro\Business\LiveScheduleA.cs:line 264
at Module.SoftProClient.Business.LiveScheduleA.GetDocuments(String OrderNumber, List`1 documentsList) in d:\FNF Global\illinois_ticortitle_com_redesign_FNFI-P2\Module.SoftPro\Business\LiveScheduleA.cs:line 241
-
- Posts: 1377
- Joined: Wed Jan 15, 2014 3:50 pm
- Location: Raleigh, NC
- Contact:
Re: Render Document using APIs in ASP.NET Application
Does the Console version still work with the SAME API CODE as used in the ASP.NET code? Are you answering the Select render prompt request with the same values? I'm wondering if one of the render prompt responses is returning an invalid object.
Bob Richards, Senior Software Developer, SoftPro
-
- Posts: 7
- Joined: Wed Mar 08, 2017 4:01 am
Re: Render Document using APIs in ASP.NET Application
Thank you for your help on this Bob.
We have a solution where we created separate DLL for SoftPro related code. ASP.NET web project and Console application both use the same DLL. All SoftPro DLLs from "C:\Program Files (x86)\SoftPro\Select" are included as reference in both ASP.NET project and Console Project.
Here is the code we are trying with:
Web Application returns error: "Type SoftPro.Select.Client.Fieldcodes.SelectFieldResolutionHandler does not implement IFieldResolutionHandler" at line:
Console returns without any error:
This document does not show any prompt when we print it from SoftPro Select. Even when we change the prompt parameter to null, we get the same exception
Our Environment:
Version: 4.2.41213.27 (4.2.3.6)
SERVER: http://JDCSWBSWB1A-T:8080
Thanks.
We have a solution where we created separate DLL for SoftPro related code. ASP.NET web project and Console application both use the same DLL. All SoftPro DLLs from "C:\Program Files (x86)\SoftPro\Select" are included as reference in both ASP.NET project and Console Project.
Here is the code we are trying with:
Code: Select all
IOrderStore os = oSelectServer.GetService<IOrderStore>();
IOrderInfo search = os.Orders.Where(x => x.Number == OrderNumber).FirstOrDefault();
IOrder order = os.OpenOrder(search, OrderEditMode.ReadOnly);
IDocumentManager dm = oSelectServer.GetService<IDocumentManager>();
IRendererFactory rendererFactory = oSelectServer.GetService<IRendererFactory>();
IRenderer renderer = rendererFactory.Create();
IDocumentInfo docInfo = dm.Documents
.Where(t => t.Title == "ALTA Commitment (6-17-06)")
.FirstOrDefault();
try
{
RenderPrompts prompts = new RenderPrompts();
IRendering rendering = renderer.Render(docInfo, order, prompts);
}
catch (Exception Ex)
{
throw Ex;
}
Code: Select all
IRendering rendering = renderer.Render(docInfo, order, prompts);
Code: Select all
IRendering rendering = renderer.Render(docInfo, order, null);
Version: 4.2.41213.27 (4.2.3.6)
SERVER: http://JDCSWBSWB1A-T:8080
Thanks.
-
- Posts: 411
- Joined: Thu Sep 11, 2008 11:35 am
- Location: Raleigh, NC, USA
- Contact:
Re: Render Document using APIs in ASP.NET Application
Are you sure that all of the DLLs you copied are from the same version release of Select?
John Morris
Sr. Software Architect
SoftPro
Sr. Software Architect
SoftPro
-
- Posts: 7
- Joined: Wed Mar 08, 2017 4:01 am
Re: Render Document using APIs in ASP.NET Application
Thank you guys for your help on this:
We are generating documents from console application now and able to get pdf out from SDK. Here is a new issue we are facing:
We are trying to print 3 documents:
We are working with API examples from here viewtopic.php?f=6&t=940&p=4184&hilit=Mi ... lues#p4006
Server: http://JTCSSPSAPP3D-T:8080/ILFUT
Version: 4.3.50811.25
Sample Order: CH17014862
Thank you in advance
We are generating documents from console application now and able to get pdf out from SDK. Here is a new issue we are facing:
We are trying to print 3 documents:
- Master Commitment (DOC_SSCORPD1411)
Initial Fee Quote (DOC_SSCORPD5409)
Master Statement, Legal (CDF) (DOC_SSCORPD5454)
We are working with API examples from here viewtopic.php?f=6&t=940&p=4184&hilit=Mi ... lues#p4006
Server: http://JTCSSPSAPP3D-T:8080/ILFUT
Version: 4.3.50811.25
Sample Order: CH17014862
Thank you in advance
- Attachments
-
- Commitment.PNG (96.9 KiB) Viewed 8351 times
-
- Posts: 1377
- Joined: Wed Jan 15, 2014 3:50 pm
- Location: Raleigh, NC
- Contact:
Re: Render Document using APIs in ASP.NET Application
I have not forgotten about you. It is taking some time to get a matching database and documents package to write code exercising the reports you referenced. At this point, I am assuming the correct context is not being passed, but I want to generate tested code. Hopefully the stars will align tomorrow.
Bob Richards, Senior Software Developer, SoftPro
-
- Posts: 7
- Joined: Wed Mar 08, 2017 4:01 am
Re: Render Document using APIs in ASP.NET Application
Hello Bob,BobRichards wrote: ↑Tue Nov 28, 2017 5:28 pm I have not forgotten about you. It is taking some time to get a matching database and documents package to write code exercising the reports you referenced. At this point, I am assuming the correct context is not being passed, but I want to generate tested code. Hopefully the stars will align tomorrow.
Please let me know if you have found something.
Thanks.
-
- Posts: 1377
- Joined: Wed Jan 15, 2014 3:50 pm
- Location: Raleigh, NC
- Contact:
Re: Render Document using APIs in ASP.NET Application
I do not have a setup that allows me to test a test a document with a complex document context like in DOC_SSCORPD1411. You will note that the rather ugly looking context for the document is:
requiring the commitment to begin with specific letters. The document I am using has the same basic requirement - except it allows any commitment to be passed to it{{Order.Title.Commitment[BeginsWith({{.RB_Code_FNF#}},"R") or BeginsWith({{.RB_Code_FNF#}},"C")]}}
The part you are potentially missing is that you must pass an order commitment to the renderer - not the entire order:{{Order.Title.Commitment}}
Code: Select all
// Get a single Commitment.
IOrderItem title = (IOrderItem)order.GetProperty("Title");
IList commitments = (IList)title.GetProperty("Commitments");
IOrderItem commitment = (IOrderItem)commitments[0];
// My document doesn't request additional prompts so pass null instead.
rendering = renderer.Render(docInfo, commitment, null);
Bob Richards, Senior Software Developer, SoftPro