2017-09-13 1 views
1

レポートの既存のOrderID列をハイパーリンクに変更します。そこで、次の<Action>コードを追加しました。しかし、それは次のエラーを投げています。誰かがこれを助けてくれますか?私はSSRSレポートを使って仕事をするのはかなり新しいです。 ありがとうございました。.rdlファイルの列にハイパーリンクを追加する方法

エラー

Unhandled Exception: System.Web.Services.Protocols.SoapException: 
System.Web.Services.Protocols.SoapException: The report definition is 
not valid. Details: The element 'Textbox' in namespace 
'http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition' 
has invalid child element 'Action' in namespace 
'http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition'. 
List of possible elements expected: 'Style, ActionInfo, Top, Left, 
Height, Width, ZIndex, Visibility, ToolTip, DocumentMapLabel, 
Bookmark, RepeatWith, CustomProperties, Paragraphs, CanGrow, 
CanShrink, HideDuplicates, ToggleImage, UserSort, KeepTogether, 
DataElementName, DataElementOutput, DataElementStyle' in namespace 
'http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition' 
as well as any element in namespace '##other'. at 
Microsoft.ReportingServices.WebServer.ReportingService2005Impl.CreateReport(String 
Report, String Parent, Boolean Overwrite, Byte[] Definition, 
Property[] Properties, Warning[]& Warnings) at 
Microsoft.ReportingServices.WebServer.ReportingService2005.CreateReport(String 
Report, String Parent, Boolean Overwrite, Byte[] Definition, 
Property[] Properties, Warning[]& Warnings) at 
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage 
message, WebResponse response, Stream responseStream, Boolean 
asyncCall) at 
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String 
methodName, Object[] parameters) at 
Microsoft.SqlServer.ReportingServices2005.ReportingService2005.CreateReport(String 
Report, String Parent, Boolean Overwrite, Byte[] Definition, 
Property[] Properties) at 
RdlSync.Repository.RemoteRdlRepository.AddRdl(IRdlFile file) at 
RdlSync.Controller.RdlReconciler.Sync(Boolean commit, Boolean useMd5, 
Boolean force) at RdlSync.Program.Main(String[] args) 

の.rdlファイルコード:示されているようにこれは、あなたの問題かもしれ

<ActionInfo> 
    <Actions> 
    <Action> 
     <Hyperlink> [link goes here] </Hyperlink> 
    </Action> 
    <Actions> 
<ActionInfo> 

<Body> 
<ReportItems> 
    <Rectangle Name="RectMain"> 
    <ReportItems> 
     <Tablix Name="tblMainReport"> 
     <TablixBody> 
     <TablixCell> 
      <CellContents> 
      <Textbox Name="orderID"> 
       <Action> 
        <Hyperlink>="javascript:window.location='QuickSearch.aspx?searchType=1&amp;amp;searchValue=" &amp; Fields!OrderId.Value &amp; "'"</Hyperlink> 
       </Action> 
       </Textbox> 
       </CellContents> 
       </TablixCell> 
     .....</TablixBody> 
     .... 
</ReportItems> 
</Body> 
+0

レポートのEnableHyperlinksプロパティをtrueに設定することを忘れないでください。 https://msdn.microsoft.com/en-us/library/microsoft.reporting.winforms.localreport.enablehyperlinks.aspx – InitK

答えて

2

私のリンクは次のようになりこの行のエラー:

List of possible elements expected: 'Style, ActionInfo, Top, ...

私は個人的に可能な限り.rdlコードの直接編集を制限し、代わりにファイルを変更するには、Visual Studioの[デザイン]タブを使用したいです。 XMLを変更すると構造が完璧でない場合は非常にエラーが発生する可能性があるので、最後の手段として保存します。

XML構造を修正するには、このような何かをする必要があります:あなたは、コードを直接編集する必要がある場合

<Textbox Name="orderID"> 
    <ActionInfo> 
    <Actions> 
     <Action> 
     <Hyperlink>="javascript:window.location='QuickSearch.aspx?searchType=1&amp;amp;searchValue=" &amp; Fields!OrderId.Value &amp; "'"</Hyperlink> 
     </Action> 
    <Actions> 
    <ActionInfo> 
</Textbox> 

、あなたが最も可能性が高い、非常に有用であることがレポート定義を検索しますエラーでリンクされています。 thisのページにリンクしています。このページにスキーマ、つまりRDLをどのように構築する必要があるかのルールが示されています。

+0

ありがとう@McGlothlin。しかし、ハイパーリンクをクリックすると、Serverエラーがスローされます。 エラー: '/ Reports'アプリケーションのサーバーエラー。 リソースが見つかりません。 説明:HTTP 404。探しているリソース(またはその依存関係の1つ)が削除されているか、名前が変更されているか、一時的に利用できない可能性があります。次のURLを確認し、正しく入力されていることを確認してください。 リクエストされたURL:/Reports/QuickSearch.aspx しかし、同じURLが他のレポートで機能しました。 – ranp

+0

フルURL、つまりリソー​​スへの絶対パスを使用して再試行してください。それでも問題が解決しない場合は、構文が正しいことを確認してください。可能性を探るのに役立つこの質問をチェックしてください:https://stackoverflow.com/questions/1597258/ssrs-relative-url-hyperlink – McGlothlin

+0

絶対パスが動作します。これは、このエラーが発生した相対パスです。古いレポートはssrs2005を使って開発されましたが、これは2008年です.JavaScriptを呼び出すと何か変わってしまうと思いますか? – ranp

関連する問題