I have a scenario where need to generate WordProcessing Report
Here is my template sample below
First Name: «FirstName»
Last Name: «LastName»
Here First Name and Last Name are keys and corresponding Merge-fields are («FirstName» & «LastName»)
Now I have to generate a report where these key and merge-fields need to repeat number of times according to the Employee record. Example if there are fice employees in database, i need to show all five employees record one after other with FirstName and LastName in sequence.
I tried with below code. But this wont help because the key and data value does not show as per template configuration.
Can you please tell me how can i achieve this in C#?
Without seeing any code I don't know if this will help. I fixed this problem in VB by converting the icon to a bitmap with the routine below. I also use ExtractIconEx. I found that icon.ToBitmap() loses resolution for some reason. Sorry, you'll have to convert to C#.
''' Convert Icon to Bitmap with resizing.
''' <param name="ic"></param>
''' <param name="sz"></param>
Public Shared Function IconToBitmap(ByVal ic As Icon, ByVal sz As Size) As Bitmap
If ic Is Nothing Then Return Nothing
Dim sourceWidth As Integer = ic.Width
Dim sourceHeight As Integer = ic.Height
Dim dPercent As Double = 0
Dim dPercentW As Double = 0
Dim dPercentH As Double = 0
If (dPercentH < dPercentW) Then
dPercent = dPercentH
dPercent = dPercentW
Dim destWidth As Integer = (sourceWidth * dPercent)
Dim destHeight As Integer = (sourceHeight * dPercent)
Dim bm As Bitmap = New Bitmap(destWidth, destHeight, PixelFormat.Format32bppArgb)
Dim g As Graphics = Graphics.FromImage(bm)
'g.InterpolationMode = Drawing2D.InterpolationMode.HighQualityBicubic
' This gives the best quality
g.InterpolationMode = Drawing2D.InterpolationMode.NearestNeighbor
g.DrawIcon(ic, New Rectangle(0, 0, destWidth, destHeight))
I have got some assembly in my sub folder and I know how to load it.
The problem is with other assemblies in this folder that this assembly is depending on.
I'm guessing that application would search for them only in it's own directory when loading assembly and not at assembly location.
Now I know about AppDomain.AssemblyResolve, but how can I subscribe to it in my assembly so I don't have to mess around with it in my main application.
Or how can I load all dependent assemblies when my assembly is loaded.