Solved

ASP -> SL

Posted on 2011-03-10
12
449 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
ID: 35110171
What type of "third party printing object" are you using (ActiveX, C++, ...)?
0
 
LVL 1

Author Comment

by:razza_b
ID: 35115737
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
ID: 35116695
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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 1

Author Comment

by:razza_b
ID: 35117057
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
ID: 35118316
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
ID: 35120114
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
 
LVL 96

Expert Comment

by:Bob Learned
ID: 35121438
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
ID: 35121514
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
ID: 35121667
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
ID: 35126851
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
ID: 35189403
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
ID: 35189428
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

830 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