|
|
Hi all,
Is there an alternative available to Aspose.Word? (managed if possible!) The Aspose pricing is just out of this world. It would cost us $1500 for just 1 developper.
Basically, we are looking to create mail merges from code. Using Word automation is out of question.
Thanks!
|
|
|
|
|
Depending on your merge data, and the appearance you want, you could use a crystal report to make your word files.
ExportType = CrystalDecisions.[Shared].ExportFormatType.WordForWindows
rpt = New CrystalDecisions.CrystalReports.Engine.ReportDocument
rpt.Load(ReportFilePath)
rpt.SetDataSource(ds)
<br> <br>
DestinationOption = New CrystalDecisions.Shared.DiskFileDestinationOptions
ReportOutputFile = DestinationPath
DestinationOption.DiskFileName = ReportOutputFile
<br> <br>
crExportOptions = rpt.ExportOptions
crExportOptions.DestinationOptions = DestinationOption
crExportOptions.ExportDestinationType = CrystalDecisions.[Shared].ExportDestinationType.DiskFile
crExportOptions.ExportFormatType = ExportType
rpt.Export()
The dataset needs to be a strongly typed dataset in order to bind it to crystal. You can just get 1 record at a time into the dataset and export the report in a loop. You can also output to pdf if you prefer.
|
|
|
|
|
I need to take an existing Word document and merge data (ie: names and addresses) into it.
|
|
|
|
|
I try to move a directroy from C:\ drive to D:\ but Directory.Move or DirectoryInfo.MoveTo methods don't allow this.
So how can I do this? And the same question for Copy.
|
|
|
|
|
Did we just go over this a few weeks ago?!
You can't Move from one volume to another. You can only Copy the source to the destination, then delete the source.
As for the Copy operation, you never showed us any code that is doing the copying and you haven't mentioned any exception messages. WIthout either of those, it's impossible to say what went wrong.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thank's I found the problem.
|
|
|
|
|
I've downloaded a solution from this site.
If i run the debug it make the .exe file and the dll.
I'm newbie abou this so i don't know wy it make this dll and where in the project propertyu it is commanded to make this dll.
I want understand what is it in that dll.
Thanks
|
|
|
|
|
You can generate a dll by creating a new project and selecting project type as "Class Library". You can always change it by right clicking on the project in Solution Explorer, clicking Properties and changing the Output Type in the resulting dialog.
If the dll has been generated by another project in the same solution, you can go to that project to see what's inside it. Otherwise, you have to use a decompiler (like Reflector) to see the contents.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Are there two projects in the solution? One would probably be a class library and the other, the Windows Forms application.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
Then you answered your own question. One project creates the .DLL, the other is the Windows Forms application that uses it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Sasuko wrote:
I've downloaded a solution from this site.
What about link? It would be very helpful...
David
|
|
|
|
|
I followed this MSDN article[^] (click on the Structs Sample link). My code is practically identical.
//Original structure
typedef struct
{
DWORD dwVar1Type;
WCHAR szVar1Name[MAX_VAR1_NAME];
} VAR1_A, *PVAR1_A, FAR *LPVAR1_A;
//C# equivalent
public struct VAR1_A
{
public UInt32 dwVar1Type;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=MAX_VAR1_NAME)]
public char[] szVar1Name;
}
The problem is, I can't seem to find an example of what to do with the pointer *PVAR1_A and the FAR pointer *LPVAR1_A.
|
|
|
|
|
You don't do anything with them. These are for creating a pointer to this structure in C/C++ code. C# has no equivilent.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
They're just typedefs, so instead of struct YourStructName variable , you can do VAR1_A variable . As Dave pointed out, they aren't needed in C#, you can simply do VAR1_A variable .
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
|
Hi, is there a way to read the names of the members of a late binding System.__ComObject?
I try to edit a Chart in Excel, but until now I get only the Charts-Object of Excel:
objSheets_Late = objBook_Late.GetType().InvokeMember( "Worksheets",<br />
BindingFlags.GetProperty, null, objBook_Late, null );<br />
objChart_Late =objBook_Late.GetType().InvokeMember("Charts", <br />
BindingFlags.GetProperty, null, objBook_Late, null );
But I do not know, how to get the Objects like Axis and their properties.
Ariadne
Cancer Research Switzerland
|
|
|
|
|
I'm trying to determine the dimensions of a string as it will appear in HTML. The closest way I've been able to do this is to use a graphics object and use MeasureString. However, there seems to be a slight difference between GDI and HTML with the dimension of strings. Does anybody know how I can reliably measure the string?
Thanks in advance.
|
|
|
|
|
You can't. The browser will display the string in whatever font was assigned to it client-side. There is no way for the server to know in what font, pitch, and browser Text Size the string will be rendered in.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Maybe I should clarify a bit more then. I want to be able to predict the flow of text that I'm placing into HTML. I'm applying styles to the text using CSS. For example, I know that it's going to be Arial 12 px. So why shouldn't I be able to determine the way that say IE or Firefox are going to render it?
|
|
|
|
|
Because there is no way to garantee that the workstation has Arial 12 pt on it. Also, the users can just click the View menu and change the Text Size, regardless of the size you think they're going to see. Also, last I checked (admittedly, a long time ago), Mac's don't have an Arial font, but they do have web browsers.
Also, the size of the browser window will change the rendered flow of the document. Not everybody runs their browsers maximized at 1280x1024. At 1920x1440, you can fit a lot of text on a single line using Arial 12pt.
You cannot determine this information server-side. If your rendering is that picky, you'll have to handle rendering in Java client-side. At least there, you've got more information about the environment you're working in.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
If I specify the font size using css the user is unable to change the font size and I'm not so sure about Macs not having Arial but that's besides the point. Also, I don't care how big the user has their browser because I just want to know the dimentions of a given set of text. I will be the one locking in the size of the text area using HTML. I simply can't believe that there is no way of determining that out without using the HTML DOM.
Still, thanks for your input.
|
|
|
|
|
You might get slightly better results if you specify your font size in points; when you use pixels, you don't know how the browser is going to interpret that. Also, you have the problem of how the ie box model differs from every other browser, so the actual size of the area where text is rendered might be different in each browser depending on your settings for margin, padding, and borders.
|
|
|
|
|
I've found so far that Firefox and IE are fairly similar when using gdi to determine the size of fonts. I'll have to check out my margin and whatnot to see if that's where I'm getting my problem from.
|
|
|
|