powered by simpleCommunicator - 2.0.35     © 2025 Programmizd 02
Форумы / Отчетные системы [игнор отключен] [закрыт для гостей] / RS 2005: Вывод barcode
5 сообщений из 5, страница 1 из 1
RS 2005: Вывод barcode
    #33777083
Добрый день!
Посоветуйте как можно в отчете вывести штрихкод в отчете (как рисунок, шрифтами или чтонить еще).
Спасибо.
...
Рейтинг: 0 / 0
RS 2005: Вывод barcode
    #33778311
guest1187
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Есть ttf-шрифты для печати баркодов.
...
Рейтинг: 0 / 0
Период между сообщениями больше года.
RS 2005: Вывод barcode
    #39102929
кириллk
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
' Creates a bitmap image of the data parameter
Public Function CreateBarcodeImage(ByVal data As String) As System.Drawing.Bitmap
Dim dataIn As String
'Since this is for Code 3 of 9 only right now, add the leading and trailing asterisks to the data
dataIn = data

'Create the Bitmap we'll be using
Dim barCode As New System.Drawing.Bitmap(1, 1)

'Get a reference to the 3 of 9 barcode font
Dim threeOfNine As New System.Drawing.Font("3 of 9 Barcode", 60, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point)

'Get a graphics object to work with
Dim graphics As System.Drawing.Graphics = graphics.FromImage(barCode)

'Now we need to get the width and height that our
'data will cover after it is rendered with the 3 of 9 font
Dim dataSize As System.Drawing.SizeF = graphics.MeasureString(dataIn, threeOfNine)

'Now we base the Bitmap's size off of this data.
barCode = New System.Drawing.Bitmap(barCode, dataSize.ToSize())

'Refresh our Graphics object with the new bitmap.
graphics = graphics.FromImage(barCode)

'Make the Graphic object's drawing surfact white.
graphics.Clear(System.Drawing.Color.White)

'Set the rendering hint to SingleBitPerPixel.
graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixel

'Draw the string onto the Graphics object
graphics.DrawString(dataIn, threeOfNine, New System.Drawing.SolidBrush(System.Drawing.Color.Black), 0, 0)

'Force the Graphics object to execute any pending operations.
graphics.Flush()

'Dispose of our objects
threeOfNine.Dispose()
graphics.Dispose()

'Return the finished barcode.
Return barCode

End Function

'Creates a barcode image of the incoming data in a format suitable for storing in the database
Public Function CreateBarcodeDBField(ByVal data As String) As Byte()
Dim image As System.Drawing.Bitmap
image = CreateBarcodeImage(data)

'Save to memory using the Gif format
Dim ms As System.IO.MemoryStream = New System.IO.MemoryStream()
image.Save(ms, System.Drawing.Imaging.ImageFormat.Gif)

Dim imageBytes As Byte() = ms.GetBuffer()
image.Dispose()
ms.Close()

' read to end
Return imageBytes
End Function

Public Function Fred as string
Return "Fred"
End Function
...
Рейтинг: 0 / 0
RS 2005: Вывод barcode
    #39102932
кириллk
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
referances
System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
...
Рейтинг: 0 / 0
RS 2005: Вывод barcode
    #39102940
кириллk
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
кириллk,

=code.CreateBarcodeDBField(Fields!NAME.Value)
...
Рейтинг: 0 / 0
5 сообщений из 5, страница 1 из 1
Форумы / Отчетные системы [игнор отключен] [закрыт для гостей] / RS 2005: Вывод barcode
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]