in Search
 
Home Blogs Forums Marketplace Files
 
 
 

trouble with GenDocument on Web App

Last post 09-04-2008, 3:37 AM by TrainerMatt. 1 replies.
Sort Posts: Previous Next
  •  07-18-2008, 5:01 AM 14086

    trouble with GenDocument on Web App

    Good Day.

    When I try to generate document on Web Form with next code

        protected void Button1_Click(object sender, EventArgs e)
        {
            Teamplate.Actions.Office.GenDocument.Execute(@"c:\out.doc", "document5", new string[] { "test1", "test2", "test3" }, new string[] { "val1", "val2", "val3" });
        }

    I have next exception:

    http://srv-ask1-wf1/NewContract.aspx?PID=474&TID=2&token=chvVXMSF1BzwcdoDe899FfSxnhSrmxrr219T6Uvjv7MjryZE5QSx69RqVW7LmyFVa5kb%252FhIZ85DjOYKuupoN2ZCpfoVTH%252FT%252Fa1K%252FJ9Fz4DZ%252B%252BkTMgeaC%252FWdFuyLurAKk5zblNHPzcU5XJZhh%252FCjEzZpdpgHeNSqe9gtKUp0XfqwuppxNAI7iSBAeOUJzEHqT0cw925F7rq4WnticoC6mwFd%252BVyhUfoXRdSPUsYV9qmaiu67PcdN5PNmkwNmm%252FLp5IMqpkxQkWfYhBzLInG09LCV9z%252Fe4aPo%252Fr7krlyrrJ2A3AaUEK5baSiT2M1U7%252FjuzcFwnMbvHUre%252BuiwMOX2Xf9nRojpfqebkeSZkWKFLLqcmSkr0yRTLYtN8joi3RNV7
    System.Exception: Could not add clause. 

    System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80040154.
    at System.Runtime.Remoting.RemotingServices.AllocateUninitializedObject(RuntimeType objectType)
    at System.Runtime.Remoting.RemotingServices.AllocateUninitializedObject(Type objectType)
    at System.Runtime.Remoting.Activation.ActivationServices.CreateInstance(Type serverType)
    at System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK(Type serverType, Object[] props, Boolean bNewObj)
    at Teamplate.Actions.Office.DocAssemblerClause.GenerateDataList()
    at Teamplate.Actions.Office.DocAssemblerClause..ctor(ClauseType nClauseType, String strClauseName, String strClausePath)
    at Teamplate.Actions.Office.DocAssembler.AddClause(String strClauseName, String strClausePath)
    at Teamplate.Actions.Office.DocAssembler.AddClause(String strClauseName, String strClausePath)
    at Teamplate.Actions.Office.GenDocument.Execute(String outputfile, String docTemplate, String[] fields, String[] data)
    at ASP.newcontract_aspx.Button1_Click(Object sender, EventArgs e) in c:\projects\ContractAgreement\web\NewContract.aspx:line 43
    at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
    at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
    at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
    at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
    at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    I am using Captaris WorkFlow 6.0 and IIS 6.
  •  09-04-2008, 3:37 AM 14202 in reply to 14086

    Re: trouble with GenDocument on Web App

    The way I have done this in the past is to save the word doc as xml and use strings like [[[field1]]] instead of real merge fields (starting with Office xp, I think). Then load up the xml in a stringbuilder, then just replace my special fields with the replacement values. I did that for my first wf project a few years ago. We replaced 200 values in a word doc and it took less than 5 or 6 seconds to do...on my laptop...better performance on the server though. The problem with the gendocument action is that the process account probably doesn't have the rights for the com interop. When we do that type of thing in Rightfax, we want the process account to be a local admin, domain user.
    Matthew Williams
    Captaris International Trainer
    Vianen, Netherlands
    blog: technovangelist.com
View as RSS news feed in XML
  Privacy    Site Terms   Contact Administrator