CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 DLL or Activex to Generate/Manipulate .DOC (word Documents)

Print topic Send  topic

Author Message
Oper


Posts: 1195
Posted: 08/28/2011, 8:55 AM

Any Suggestion?

_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)

http://www.PremiumWebTemplate.com
Affiliation Web Site Templates

Please do backup first
View profile  Send private message
andrewi

Posts: 162
Posted: 08/29/2011, 11:31 AM

(not quite answering your question) My approach was to use Word as the editor, and put in field place-holders using brackets - [FirstName] [SecondName] etc. But I saved it as rtf. The web page code then read the rtf file and carried out a simple Replace on the field place-holders. Then it served the result, which opened in Word (looking like a doc as far as the user could tell).

View profile  Send private message
Oper


Posts: 1195
Posted: 08/29/2011, 12:08 PM

Well Sir,
That Sound like a Great Solution (RTF) stuff)

will do similat APROACH but dont use BRAKET we use $$NAME and $$LASTNAME and use HTML output, but now we would like to use WORD for onr customer

what do you use to parse/manipulate RTF?

we will buy any Activex or DLL/
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)

http://www.PremiumWebTemplate.com
Affiliation Web Site Templates

Please do backup first
View profile  Send private message
andrewi

Posts: 162
Posted: 08/29/2011, 2:26 PM

There's almost nothing to the code (which was in my shaky vb.net 1.1)

This first bit of code just opened a recordset (using strSQL) containing the data to be merged. I made sure that the query column names matched the place holders in the rtf template, so all I had to do was loop through the set of columns in the query, add my [ and ] around the column names, then do a simple Replace on the rtf file.

What made it simpler is that I could save the rtf file (which is ASCII) in a table, so I just had to read it into a variable (strRTFsource).

     
   ...  
        Dim ds As DataSet = SqlHelper.ExecuteDataset(ConnString, strSQL ...)  
        If ds.Tables(0).Rows.Count < 1 Then GoTo sub_Exit  
        Dim dr As DataRow = ds.Tables(0).Rows(0)  
        For Each objCol In ds.Tables(0).Columns  
            strRTFSource = Replace(strRTFSource, "[" & objCol.ColumnName.ToString & _  
             "]", dr(objCol.ColumnName.ToString) & "")  
        Next  
...  

you would change the replace line to something like
  strRTFSource =  Replace(strRTFSource, "$$" & ColumnName, ColumnValue)
to get the $$PLACEHOLDER format.

After that, you have to serve the rtf string in a way that will open in Word. I did it like this:
  
        Response.ContentType = "application/msword"  
        Response.ContentEncoding = System.Text.Encoding.Default  
        Response.Charset = ""  
        Response.Write(strRTFSource)  
        Response.End()  

If that's of any interest I can clarify it. You won't want to use my actual code if you can help it!
View profile  Send private message
Oper


Posts: 1195
Posted: 08/29/2011, 3:15 PM

ah ok, so you only opened like any other TXT

I think that will work for me also.

_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)

http://www.PremiumWebTemplate.com
Affiliation Web Site Templates

Please do backup first
View profile  Send private message
dragoon


Posts: 173
Posted: 09/15/2011, 2:34 PM

Hi Oper,

We have a solution that works the same way as andrewi's, but instead on using RTF we use xml files (generated with word). No problems on opening the xml files with Word, as we have from Office 2003 to Office 2010 spread across company.


Drawback: in place editing the files over web - can't be achieved but with a SharePoint solution (or something alike)
View profile  Send private message
andrewi

Posts: 162
Posted: 09/16/2011, 8:59 AM

If you wanted online editing, then what about using HTML (with placeholders)? You could use an HTML editor in the web page & save to table or to file as appropriate.

The code above would probably display it correctly. Word is quite forgiving: if it spots HTML it seems to display it appropriately, regardless of the file extension.
View profile  Send private message
dragoon


Posts: 173
Posted: 09/18/2011, 9:34 AM

Quote andrewi:
If you wanted online editing, then what about using HTML (with placeholders)? You could use an HTML editor in the web page & save to table or to file as appropriate.

The code above would probably display it correctly. Word is quite forgiving: if it spots HTML it seems to display it appropriately, regardless of the file extension.

The templates are quite large (up to 10 pages). Might be worth a try... if IE is not going to crash :-D

Thanks.
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.