Reporting services 如何在RDLC文本框中显示大量数据

Reporting services 如何在RDLC文本框中显示大量数据,reporting-services,rdlc,Reporting Services,Rdlc,我有一个rdlc报告,它显示从Microsoft SQL 2008数据库中的单个文本字段检索的转录信息。报告很简单,因为它由一个短标题和一个包含单个文本框的正文组成。我们面临的问题是一些报告数据被切断。没有错误信息,只是被切断了。经过一些测试后,我们确定文本框可以剪切大约32000个字符。在这个发现之后,我做了一些研究,我发现唯一有用的是引用了msdn 我们遇到的一些抄本包含500000个字符,我们无法知道这是否会增加。有没有办法绕过报告文本框32000个字符的限制?我提出的解决方案是编写一些T

我有一个rdlc报告,它显示从Microsoft SQL 2008数据库中的单个文本字段检索的转录信息。报告很简单,因为它由一个短标题和一个包含单个文本框的正文组成。我们面临的问题是一些报告数据被切断。没有错误信息,只是被切断了。经过一些测试后,我们确定文本框可以剪切大约32000个字符。在这个发现之后,我做了一些研究,我发现唯一有用的是引用了msdn
我们遇到的一些抄本包含500000个字符,我们无法知道这是否会增加。有没有办法绕过报告文本框32000个字符的限制?

我提出的解决方案是编写一些T-SQL来分解大块文本 然后返回一个表,每30000个字符的文本块返回一行。然后在报告中将我的文本框放入列表中。 下面是SQL语句

declare @transcriptionBody TABLE 
(
    SegmentNumber int identity(1,1),
    BodyPart nvarchar(max)
)
declare 
    @bodyPart varchar(max),
    @body nvarchar(max),
    @indexToLastNewLineInBodyPart int,
    @lenOfBody int,
    @MAX_CHARACTERS int,
    @numberOfCharactersLeftInString int,
    @position int

set @MAX_CHARACTERS = 30000
set @indexToLastNewLineInBodyPart = 0
set @numberOfCharactersLeftInString = 0
set @position = 0

/*
 *  Get the long string of characters from your database. In this example the 
 *  [Body] field is a text field.
*/
select @body = Body from [Transcription] with(nolock) where Id = @TranscriptionId
set @lenOfBody = len(@body)

/*
 *  Loop through the @body variable chopping up the string into managable chuncks
 *  and inserting those chuncks into a table variable called @transcriptionBody.
 *  The loop exists when the 
*/
while (@position < @lenOfBody)
begin

    /*
     *  If the transcription body is less than 30,000 then insert it into
     *  our table variable and return.
    */
    if (@lenOfBody <= @MAX_CHARACTERS and @position = 0)
    begin
        insert into @transcriptionBody(BodyPart) values(@body)
        set @position = @lenOfBody
    end

    /*
     *  Otherwise we need do the following
     *  1.  Get the number of chars in the string starting from the input start index.
     *  2.  If the number of chars in the string is > than the max allowable chars then
     *      substring off the first 30,000 chars into a body part.
     *      
     *      2a. Now have a string consisting of 30,000 chars but you have no idea where it
     *          cut off (it could be in the middle of a word). So you now need to get the 
     *          index of the last newline and re-break the string on that.Then insert it
     *          into the table variable and set the position.
     *
     *  3.  If the number of chars in the string IS NOT > than the max allowable chars
     *      then substring off the remaining chars into a body part and insert it into our
     *      table variable
    */
    else
    begin
        -- 1.
        select @numberOfCharactersLeftInString = (@position - @lenOfBody) * -1

        -- 2.
        if (@numberOfCharactersLeftInString > @MAX_CHARACTERS)
        begin
            select @bodyPart = substring(@body, @position, @MAX_CHARACTERS)

            -- 2a.
            select @indexToLastNewLineInBodyPart = Len(@bodyPart) - charindex(char(13)+char(10),reverse(@bodyPart))
            if (@indexToLastNewLineInBodyPart > 0)
            begin
                select @bodyPart = substring(@bodyPart,@position,@indexToLastNewLineInBodyPart)
                insert into @transcriptionBody(BodyPart) values(@bodyPart)
                select @position = @position + len(@bodyPart)
            end     
        end
        else
        begin
            select @bodyPart = substring(@body, @position, @numberOfCharactersLeftInString)
            insert into @transcriptionBody(BodyPart) values(@bodyPart)
            select @position = @position + len(@bodyPart)
        end 
    end
end
select * from @transcriptionBody order by SegmentNumber
declare@transactionbody表
(
分段编号整数标识(1,1),
车身部件nvarchar(最大值)
)
声明
@车身部件varchar(最大值),
@车身nvarchar(最大值),
@indexToLastNewLineInBodyPart int,
@lenOfBody int,
@最大字符数,
@NumberOfCharactersRefisting int,
@位置int
设置@MAX_CHARACTERS=30000
设置@indexToLastNewLineInBodyPart=0
设置@numberOfCharactersLeftInstalling=0
设置@position=0
/*
*从数据库中获取长字符串。在本例中
*[Body]字段是一个文本字段。
*/
使用(nolock)从[Transcription]中选择@body=body,其中Id=@TranscriptionId
设置@lenOfBody=len(@body)
/*
*循环@body变量,将字符串切碎为可管理的字符串
*并将这些Chunck插入名为@TransactionBody的表变量中。
*当
*/
while(@位置<@lenOfBody)
开始
/*
*如果转录体小于30000,则将其插入
*我们的表变量和返回。
*/
如果(@lenOfBody)超过最大允许字符数,则
*将前30000个字符细分为身体部分。
*      
*2a.现在有一个由30000个字符组成的字符串,但你不知道它在哪里
*切断(它可以在一个词的中间)。所以你现在需要得到。
*索引最后一个换行符并重新打断该换行符上的字符串。然后插入它
*输入表格变量并设置位置。
*
*3.如果字符串中的字符数不大于允许的最大字符数
*然后将剩余的字符分串到身体部位,并将其插入我们的
*表变量
*/
其他的
开始
-- 1.
选择@NumberOfCharactersRefInstalling=(@position-@lenOfBody)*-1
-- 2.
如果(@numberOfCharactersLeftInstalling>@MAX\u个字符)
开始
选择@bodyPart=子字符串(@body、@position、@MAX\u个字符)
--2a。
选择@indexToLastNewLineInBodyPart=Len(@bodyPart)-charindex(char(13)+char(10),反向(@bodyPart))
如果(@indexToLastNewLineInBodyPart>0)
开始
选择@bodyPart=子字符串(@bodyPart、@position、@indexToLastNewLineInBodyPart)
插入@TransactionBody(BodyPart)值(@BodyPart)
选择@position=@position+len(@bodyPart)
结束
结束
其他的
开始
选择@bodyPart=子字符串(@body、@position、@NumberOfCharactersRefInstalling)
插入@TransactionBody(BodyPart)值(@BodyPart)
选择@position=@position+len(@bodyPart)
结束
结束
结束
从@TransactionBody order by SegmentNumber中选择*

我想出的解决方案是编写一些T-SQL来分解大块文本 然后返回一个表,每30000个字符的文本块返回一行。然后在报告中将我的文本框放入列表中。 下面是SQL语句

declare @transcriptionBody TABLE 
(
    SegmentNumber int identity(1,1),
    BodyPart nvarchar(max)
)
declare 
    @bodyPart varchar(max),
    @body nvarchar(max),
    @indexToLastNewLineInBodyPart int,
    @lenOfBody int,
    @MAX_CHARACTERS int,
    @numberOfCharactersLeftInString int,
    @position int

set @MAX_CHARACTERS = 30000
set @indexToLastNewLineInBodyPart = 0
set @numberOfCharactersLeftInString = 0
set @position = 0

/*
 *  Get the long string of characters from your database. In this example the 
 *  [Body] field is a text field.
*/
select @body = Body from [Transcription] with(nolock) where Id = @TranscriptionId
set @lenOfBody = len(@body)

/*
 *  Loop through the @body variable chopping up the string into managable chuncks
 *  and inserting those chuncks into a table variable called @transcriptionBody.
 *  The loop exists when the 
*/
while (@position < @lenOfBody)
begin

    /*
     *  If the transcription body is less than 30,000 then insert it into
     *  our table variable and return.
    */
    if (@lenOfBody <= @MAX_CHARACTERS and @position = 0)
    begin
        insert into @transcriptionBody(BodyPart) values(@body)
        set @position = @lenOfBody
    end

    /*
     *  Otherwise we need do the following
     *  1.  Get the number of chars in the string starting from the input start index.
     *  2.  If the number of chars in the string is > than the max allowable chars then
     *      substring off the first 30,000 chars into a body part.
     *      
     *      2a. Now have a string consisting of 30,000 chars but you have no idea where it
     *          cut off (it could be in the middle of a word). So you now need to get the 
     *          index of the last newline and re-break the string on that.Then insert it
     *          into the table variable and set the position.
     *
     *  3.  If the number of chars in the string IS NOT > than the max allowable chars
     *      then substring off the remaining chars into a body part and insert it into our
     *      table variable
    */
    else
    begin
        -- 1.
        select @numberOfCharactersLeftInString = (@position - @lenOfBody) * -1

        -- 2.
        if (@numberOfCharactersLeftInString > @MAX_CHARACTERS)
        begin
            select @bodyPart = substring(@body, @position, @MAX_CHARACTERS)

            -- 2a.
            select @indexToLastNewLineInBodyPart = Len(@bodyPart) - charindex(char(13)+char(10),reverse(@bodyPart))
            if (@indexToLastNewLineInBodyPart > 0)
            begin
                select @bodyPart = substring(@bodyPart,@position,@indexToLastNewLineInBodyPart)
                insert into @transcriptionBody(BodyPart) values(@bodyPart)
                select @position = @position + len(@bodyPart)
            end     
        end
        else
        begin
            select @bodyPart = substring(@body, @position, @numberOfCharactersLeftInString)
            insert into @transcriptionBody(BodyPart) values(@bodyPart)
            select @position = @position + len(@bodyPart)
        end 
    end
end
select * from @transcriptionBody order by SegmentNumber
declare@transactionbody表
(
分段编号整数标识(1,1),
车身部件nvarchar(最大值)
)
声明
@车身部件varchar(最大值),
@车身nvarchar(最大值),
@indexToLastNewLineInBodyPart int,
@lenOfBody int,
@最大字符数,
@NumberOfCharactersRefisting int,
@位置int
设置@MAX_CHARACTERS=30000
设置@indexToLastNewLineInBodyPart=0
设置@numberOfCharactersLeftInstalling=0
设置@position=0
/*
*从数据库中获取长字符串
*[Body]字段是一个文本字段。
*/
使用(nolock)从[Transcription]中选择@body=body,其中Id=@TranscriptionId
设置@lenOfBody=len(@body)
/*
*循环@body变量,将字符串切碎为可管理的字符串
*并将这些Chunck插入名为@TransactionBody的表变量中。
*当
*/
while(@位置<@lenOfBody)
开始
/*
*如果转录体小于30000,则将其插入
*我们的表变量和返回。
*/
如果(@lenOfBody)超过最大允许字符数,则
*将前30000个字符细分为身体部分。
*      
*2a.现在有一个由30000个字符组成的字符串,但你不知道它在哪里
*切断(它可以在一个词的中间)。所以你现在需要得到。
*索引最后一个换行符并重新打断该换行符上的字符串。然后插入它
*输入表格变量并设置位置。
*
*3.如果字符串中的字符数不大于允许的最大字符数
*然后将剩余的字符分串到身体部位,并将其插入我们的
*表变量
*/
其他的
开始
-- 1.
选择@NumberOfCharactersRefInstalling=(@position-@lenOfBody)*-1
-- 2.
如果(@numberOfCharactersFliftInstalling>@MAX\u CHARA