Solved

ASP -> SL

Posted on 2011-03-10
12
441 Views
Last Modified: 2013-11-12
Hi Experts

I have an ASP page that prints using a third party printing object through its designer, but wondered if i can do this in a SL4? If so what can i do with existing code to transfer in SL.

I have attached the code and 2 screenshots - one of the page and the printed label just to show how the ASP works

Thanks
XCEL-100-SATA-2-5.pdf
ASP-screenshot.docx
ASPSSD.txt
0
Comment
Question by:razza_b
  • 7
  • 5
12 Comments
 
LVL 96

Expert Comment

by:Bob Learned
Comment Utility
What type of "third party printing object" are you using (ActiveX, C++, ...)?
0
 
LVL 1

Author Comment

by:razza_b
Comment Utility
We use a designer called TFormer and thats where i create the label, then the names(values) on label is used in code and then the dll is added to solution and i use the objects from that to help do printing, to get the repo name, form name etc.

these are the fields on label and in asp(see attachment)...
          Job.RepositoryName = "<%=TFormerRepository%>"
          Job.ProjectName = "<%=RS("LabelProject")%>"
          Job.FormName = "<%=RS("LabelType")%>"
          Job.PrinterName = ""
          JobData.AddNewRecord() // add a new record. Each record prints the Detail Band of the form
          Jobdata.SetDataField "PartNumber","<%=RS("PartNumber")%>"
          Jobdata.SetDataField "SerialNumber","<%=RS("Serial")%>"
          Jobdata.SetDataField "CustomerSerialNumber","<%=RS("CPN")%>"
          Jobdata.SetDataField "CustDesc","<%=REPLACE(RS("CustomerDesc"),CHR(34),"")%>"
          Jobdata.SetDataField "WWNumber","<%=RS("WWN")%>"
          Jobdata.SetDataField "COO","<%=RS("COO")%>"
          Jobdata.SetDataField "Model","<%=RS("SmartModel")%>"
          Jobdata.SetDataField "WorkOrder","<%=RS("WorkOrder")%>"
          Jobdata.SetDataField "CPN","<%=RS("CustomerModel")%>"
          Jobdata.SetDataField "Revision","<%=RS("CustomerRev")%>"
          Jobdata.SetDataField "Firmware","<%=RS("Firmware")%>"
          Jobdata.SetDataField "Capacity","<%=RS("Capacity")%>"
          Jobdata.SetDataField "Interface","<%=RS("Interface")%>"
          Jobdata.SetDataField "DOM","<%=RS("DOM")%>"


Thanks
0
 
LVL 96

Expert Comment

by:Bob Learned
Comment Utility
I haven't heard of TFormer, but if it is ActiveX, you need to do something special to work with ActiveX, such as creating an HTML page, with a reference to the ActiveX control.
0
 
LVL 1

Author Comment

by:razza_b
Comment Utility
I could get TFormer working myself its just the rest of the code in the asp page i want to use in SL if its possible.

Would it be possible to use/modify code into SL?

0
 
LVL 96

Assisted Solution

by:Bob Learned
Bob Learned earned 500 total points
Comment Utility
I am not sure what you mean by "the rest of the code"...I don't think that you can use ASP classic code in Silverlight, unmodified, so you would need to re-engineer as .NET code.
0
 
LVL 1

Author Comment

by:razza_b
Comment Utility
i mean tformer not a problem(designer & dll), the"rest of the code" what i have shown you can it be easily re-engineered in SL?

so i can basically use this in the xaml.cs(obviously modified for c#)....

// db connection here

<%IF Len(SerialNumber) > 1 THEN
        SQL="EXECUTE wsp_PrintSSDProductLabel '" & SerialNumber  & "'"
        'RETURNS : Plant,WorkOrder,Serial,WWN,CPN,CustomerRev,DOM,PartNumber,CustomerModel,CustomerDesc,SmartModel,Capacity,Interface,Firmware,Coo,LabelType,LabelProject,PrintFlag

        RS.Open(SQL)
                'Print Labels
        Sub PrintLabel()
          set Job = window.TF.CreateJob()
          set JobData = Job.NewJobDataRecordSet()
          TF.License "Modular Technologies, Inc.",3,2,"A34AB63D4F7CAFD40E6969220DDC9"
         Job.RepositoryName = "<%=TFormerRepository%>"
         Job.ProjectName = "<%=RS("LabelProject")%>"
          Job.FormName = "<%=RS("LabelType")%>"
          Job.PrinterName = ""
          JobData.AddNewRecord() // add a new record. Each record prints the Detail Band of the form
          Jobdata.SetDataField "PartNumber","<%=RS("PartNumber")%>"
          Jobdata.SetDataField "SerialNumber","<%=RS("Serial")%>"
          Jobdata.SetDataField "CustomerSerialNumber","<%=RS("CPN")%>"
          Jobdata.SetDataField "CustDesc","<%=REPLACE(RS("CustomerDesc"),CHR(34),"")%>"
          Jobdata.SetDataField "WWNumber","<%=RS("WWN")%>"
          Jobdata.SetDataField "COO","<%=RS("COO")%>"
          Jobdata.SetDataField "Model","<%=RS("SmartModel")%>"
          Jobdata.SetDataField "WorkOrder","<%=RS("WorkOrder")%>"
          Jobdata.SetDataField "CPN","<%=RS("CustomerModel")%>"
          Jobdata.SetDataField "Revision","<%=RS("CustomerRev")%>"
          Jobdata.SetDataField "Firmware","<%=RS("Firmware")%>"
          Jobdata.SetDataField "Capacity","<%=RS("Capacity")%>"
          Jobdata.SetDataField "Interface","<%=RS("Interface")%>"
          Jobdata.SetDataField "DOM","<%=RS("DOM")%>"

          Job.PrintForm()

        End Sub
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 96

Expert Comment

by:Bob Learned
Comment Utility
The code looks pretty straightforward, with lines to set properties, and call the PrintForm method.

What does NewJobDataRecordSet represent in this line?

set JobData = Job.NewJobDataRecordSet()

Open in new window

   

Is it an ADO classic Recordset object?    
0
 
LVL 1

Author Comment

by:razza_b
Comment Utility
yes it an ADO classic Recordset object, but i think i know what ive to do should be striaght foward, just wanted someone's opinion about taking asp to SL, but your right its just .net code, i was thinking SL would need to have something similar in xaml to asp.
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
Comment Utility
This wouldn't be XAML, since that is declarative definition for a control.  That code would need to go in the code-behind xaml.cs file.  .NET can work with ADO classic Recordset object, if that is what the TFormer control uses.  This should be achievable in Silverlight, if that is all you are looking for.
0
 
LVL 1

Author Comment

by:razza_b
Comment Utility
yeah ok, once i get the dll into SL project this should be fine (but also refereing to other post about tformer dll), will update asap.
0
 
LVL 1

Author Comment

by:razza_b
Comment Utility
Added a SL class library and created classes for the third party dll to be written in C# code for the purposes of printing with SL.
0
 
LVL 1

Author Closing Comment

by:razza_b
Comment Utility
This is what i had to do to get third party printing dll that was written in .net to be able to work within SL
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now